{"action":"created","issue":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3073","repository_url":"https://api.github.com/repos/RobotLocomotion/drake","labels_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3073/labels{/name}","comments_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3073/comments","events_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3073/events","html_url":"https://github.com/RobotLocomotion/drake/pull/3073","id":169656012,"number":3073,"title":"Switch to using overloaded functions to add constraints/costs to an OptimizationProblem","user":{"login":"sammy-tri","id":17596504,"avatar_url":"https://avatars.githubusercontent.com/u/17596504?v=3","gravatar_id":"","url":"https://api.github.com/users/sammy-tri","html_url":"https://github.com/sammy-tri","followers_url":"https://api.github.com/users/sammy-tri/followers","following_url":"https://api.github.com/users/sammy-tri/following{/other_user}","gists_url":"https://api.github.com/users/sammy-tri/gists{/gist_id}","starred_url":"https://api.github.com/users/sammy-tri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sammy-tri/subscriptions","organizations_url":"https://api.github.com/users/sammy-tri/orgs","repos_url":"https://api.github.com/users/sammy-tri/repos","events_url":"https://api.github.com/users/sammy-tri/events{/privacy}","received_events_url":"https://api.github.com/users/sammy-tri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ggould-tri","id":17596413,"avatar_url":"https://avatars.githubusercontent.com/u/17596413?v=3","gravatar_id":"","url":"https://api.github.com/users/ggould-tri","html_url":"https://github.com/ggould-tri","followers_url":"https://api.github.com/users/ggould-tri/followers","following_url":"https://api.github.com/users/ggould-tri/following{/other_user}","gists_url":"https://api.github.com/users/ggould-tri/gists{/gist_id}","starred_url":"https://api.github.com/users/ggould-tri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggould-tri/subscriptions","organizations_url":"https://api.github.com/users/ggould-tri/orgs","repos_url":"https://api.github.com/users/ggould-tri/repos","events_url":"https://api.github.com/users/ggould-tri/events{/privacy}","received_events_url":"https://api.github.com/users/ggould-tri/received_events","type":"User","site_admin":false},"assignees":[{"login":"david-german-tri","id":17437069,"avatar_url":"https://avatars.githubusercontent.com/u/17437069?v=3","gravatar_id":"","url":"https://api.github.com/users/david-german-tri","html_url":"https://github.com/david-german-tri","followers_url":"https://api.github.com/users/david-german-tri/followers","following_url":"https://api.github.com/users/david-german-tri/following{/other_user}","gists_url":"https://api.github.com/users/david-german-tri/gists{/gist_id}","starred_url":"https://api.github.com/users/david-german-tri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-german-tri/subscriptions","organizations_url":"https://api.github.com/users/david-german-tri/orgs","repos_url":"https://api.github.com/users/david-german-tri/repos","events_url":"https://api.github.com/users/david-german-tri/events{/privacy}","received_events_url":"https://api.github.com/users/david-german-tri/received_events","type":"User","site_admin":false},{"login":"ggould-tri","id":17596413,"avatar_url":"https://avatars.githubusercontent.com/u/17596413?v=3","gravatar_id":"","url":"https://api.github.com/users/ggould-tri","html_url":"https://github.com/ggould-tri","followers_url":"https://api.github.com/users/ggould-tri/followers","following_url":"https://api.github.com/users/ggould-tri/following{/other_user}","gists_url":"https://api.github.com/users/ggould-tri/gists{/gist_id}","starred_url":"https://api.github.com/users/ggould-tri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggould-tri/subscriptions","organizations_url":"https://api.github.com/users/ggould-tri/orgs","repos_url":"https://api.github.com/users/ggould-tri/repos","events_url":"https://api.github.com/users/ggould-tri/events{/privacy}","received_events_url":"https://api.github.com/users/ggould-tri/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-08-05T17:24:58Z","updated_at":"2016-08-05T19:43:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/RobotLocomotion/drake/pulls/3073","html_url":"https://github.com/RobotLocomotion/drake/pull/3073","diff_url":"https://github.com/RobotLocomotion/drake/pull/3073.diff","patch_url":"https://github.com/RobotLocomotion/drake/pull/3073.patch"},"body":"The intent of this change is to allow (templated) callers which have\r\nbeen passed a constraint of unknown type as a parameter to add\r\nconstraints (costs) to the proper list.\r\n\r\nExample:\r\n\r\n  template <typename ConstraintT>\r\n  void AddStateConstraint(std::shared_ptr<ConstraintT> constraint,\r\n                          const std::vector<int>& time_indices) {\r\n    for (const int i: time_indices) {\r\n      DRAKE_ASSERT(i < N_);\r\n      opt_problem_.AddConstraint(\r\n          constraint, {x_vars_.segment(i * num_states_, num_states_)});\r\n    }\r\n  }\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/robotlocomotion/drake/3073)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/comments/237944647","html_url":"https://github.com/RobotLocomotion/drake/pull/3073#issuecomment-237944647","issue_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3073","id":237944647,"user":{"login":"david-german-tri","id":17437069,"avatar_url":"https://avatars.githubusercontent.com/u/17437069?v=3","gravatar_id":"","url":"https://api.github.com/users/david-german-tri","html_url":"https://github.com/david-german-tri","followers_url":"https://api.github.com/users/david-german-tri/followers","following_url":"https://api.github.com/users/david-german-tri/following{/other_user}","gists_url":"https://api.github.com/users/david-german-tri/gists{/gist_id}","starred_url":"https://api.github.com/users/david-german-tri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-german-tri/subscriptions","organizations_url":"https://api.github.com/users/david-german-tri/orgs","repos_url":"https://api.github.com/users/david-german-tri/repos","events_url":"https://api.github.com/users/david-german-tri/events{/privacy}","received_events_url":"https://api.github.com/users/david-german-tri/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T19:43:29Z","updated_at":"2016-08-05T19:43:29Z","body":"Cleared up in f2f conversation - the key word is \"templated\".  Consider adding a test case illustrating this.  Otherwise <img class=\"emoji\" title=\":lgtm:\" alt=\":lgtm:\" align=\"absmiddle\" src=\"https://reviewable.io/lgtm.png\" height=\"20\" width=\"61\"/> aside from a couple of BTW nits\n\n---\n\nReview status: 0 of 6 files reviewed at latest revision, 2 unresolved discussions.\n\n---\n\n*[drake/solvers/optimization.h, line 174 \\[r2\\]](https://reviewable.io:443/reviews/robotlocomotion/drake/3073#-KORDgUTLC5xX0VScu1f:-KOR0vzF9pdWdSzOGBZl:bxr6jos) ([raw file](https://github.com/robotlocomotion/drake/blob/b5381fdaf6aca1c4ab4368a8d9d7e8414b57b997/drake/solvers/optimization.h#L174)):*\n> ```objc\n> \n>   /**\n>    * Add a cost to the problem which covers all decision\n> ```\n\nnit: Adds\n\n---\n\n*[drake/solvers/optimization.h, line 288 \\[r2\\]](https://reviewable.io:443/reviews/robotlocomotion/drake/3073#-KORDiFrQ0FgniqQWil1:-KOR27zmvkIDcpQYv2hD:b-j21vaa) ([raw file](https://github.com/robotlocomotion/drake/blob/b5381fdaf6aca1c4ab4368a8d9d7e8414b57b997/drake/solvers/optimization.h#L288)):*\n> ```objc\n> \n>   /**\n>    * Add a constraint to the problem which covers all decision\n> ```\n\nnit: Adds\n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io:443/reviews/robotlocomotion/drake/3073#-:-KORDXIpd9k1Xxad3Z6E:b-776etn)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"david-german-tri"}}