{"action":"created","issue":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3142","repository_url":"https://api.github.com/repos/RobotLocomotion/drake","labels_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3142/labels{/name}","comments_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3142/comments","events_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3142/events","html_url":"https://github.com/RobotLocomotion/drake/issues/3142","id":171154964,"number":3142,"title":"Need Utility Methods That Return Pose of Model Instance","user":{"login":"liangfok","id":1388098,"avatar_url":"https://avatars.githubusercontent.com/u/1388098?v=3","gravatar_id":"","url":"https://api.github.com/users/liangfok","html_url":"https://github.com/liangfok","followers_url":"https://api.github.com/users/liangfok/followers","following_url":"https://api.github.com/users/liangfok/following{/other_user}","gists_url":"https://api.github.com/users/liangfok/gists{/gist_id}","starred_url":"https://api.github.com/users/liangfok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liangfok/subscriptions","organizations_url":"https://api.github.com/users/liangfok/orgs","repos_url":"https://api.github.com/users/liangfok/repos","events_url":"https://api.github.com/users/liangfok/events{/privacy}","received_events_url":"https://api.github.com/users/liangfok/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RobotLocomotion/drake/labels/priority:%20high","name":"priority: high","color":"b60205"},{"url":"https://api.github.com/repos/RobotLocomotion/drake/labels/team:%20software%20core","name":"team: software core","color":"0052cc"},{"url":"https://api.github.com/repos/RobotLocomotion/drake/labels/type:%20feature%20request","name":"type: feature request","color":"0e8a16"}],"state":"open","locked":false,"assignee":{"login":"liangfok","id":1388098,"avatar_url":"https://avatars.githubusercontent.com/u/1388098?v=3","gravatar_id":"","url":"https://api.github.com/users/liangfok","html_url":"https://github.com/liangfok","followers_url":"https://api.github.com/users/liangfok/followers","following_url":"https://api.github.com/users/liangfok/following{/other_user}","gists_url":"https://api.github.com/users/liangfok/gists{/gist_id}","starred_url":"https://api.github.com/users/liangfok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liangfok/subscriptions","organizations_url":"https://api.github.com/users/liangfok/orgs","repos_url":"https://api.github.com/users/liangfok/repos","events_url":"https://api.github.com/users/liangfok/events{/privacy}","received_events_url":"https://api.github.com/users/liangfok/received_events","type":"User","site_admin":false},"assignees":[{"login":"liangfok","id":1388098,"avatar_url":"https://avatars.githubusercontent.com/u/1388098?v=3","gravatar_id":"","url":"https://api.github.com/users/liangfok","html_url":"https://github.com/liangfok","followers_url":"https://api.github.com/users/liangfok/followers","following_url":"https://api.github.com/users/liangfok/following{/other_user}","gists_url":"https://api.github.com/users/liangfok/gists{/gist_id}","starred_url":"https://api.github.com/users/liangfok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liangfok/subscriptions","organizations_url":"https://api.github.com/users/liangfok/orgs","repos_url":"https://api.github.com/users/liangfok/repos","events_url":"https://api.github.com/users/liangfok/events{/privacy}","received_events_url":"https://api.github.com/users/liangfok/received_events","type":"User","site_admin":false},{"login":"hongkai-dai","id":6314000,"avatar_url":"https://avatars.githubusercontent.com/u/6314000?v=3","gravatar_id":"","url":"https://api.github.com/users/hongkai-dai","html_url":"https://github.com/hongkai-dai","followers_url":"https://api.github.com/users/hongkai-dai/followers","following_url":"https://api.github.com/users/hongkai-dai/following{/other_user}","gists_url":"https://api.github.com/users/hongkai-dai/gists{/gist_id}","starred_url":"https://api.github.com/users/hongkai-dai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hongkai-dai/subscriptions","organizations_url":"https://api.github.com/users/hongkai-dai/orgs","repos_url":"https://api.github.com/users/hongkai-dai/repos","events_url":"https://api.github.com/users/hongkai-dai/events{/privacy}","received_events_url":"https://api.github.com/users/hongkai-dai/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-08-15T11:41:21Z","updated_at":"2016-08-16T06:56:59Z","closed_at":null,"body":"Currently, determining a model instance's pose is difficult because it requires checking joint types and DOFs (within `DrakeJoint`), and system state vector indices (within `RigidBodyTree`). It results in writing a huge amount of code to achieve a relatively simple task that's frequently needed. For example, see [this](https://github.com/liangfok/drake/blob/d47e08eed79bf79824ed507b7603a7c2c5c24959/ros/drake_ros_systems/include/drake/ros/systems/ros_sensor_publisher_joint_state.h#L353). We should provide some utility methods in `RigidBodyTree` that does this work once and for all.\r\n\r\nHere's a suggestion. \r\n\r\n```\r\n/**\r\n * Returns true if the specified model instance is connected to the rest of the\r\n * `RigidBodyTree` by a floating joint. Note that the model instance need not be\r\n * directly connected to the world for this method to return `true`.\r\n */\r\nbool RigidBodyTree::HasFloatingRoot(int model_instance_id);\r\n\r\n/**\r\n * Returns the pose of a model instance in Euler angles (i.e., x, y, z, roll, pitch, yaw).\r\n * Throws an `std::runtime_error` if @p model_instance_id is invalid or if the model\r\n * instance is not connected to the rest of the `RigidBodyTree` via a floating joint.\r\n */\r\nVector6d RigidBodyTree::GetPoseRPY(int model_instance_id);\r\n\r\n\r\n/**\r\n * Returns the pose of a model instance in Euler angles (i.e., x, y, z, qx, qy, qz, qw).\r\n * Throws an `std::runtime_error` if @p model_instance_id is invalid or if the model\r\n * instance is not connected to the rest of the `RigidBodyTree` via a floating joint.\r\n */\r\nVector7d RigidBodyTree::GetPoseQuaternion(int model_instance_id);\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/comments/240018820","html_url":"https://github.com/RobotLocomotion/drake/issues/3142#issuecomment-240018820","issue_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/3142","id":240018820,"user":{"login":"sherm1","id":4088016,"avatar_url":"https://avatars.githubusercontent.com/u/4088016?v=3","gravatar_id":"","url":"https://api.github.com/users/sherm1","html_url":"https://github.com/sherm1","followers_url":"https://api.github.com/users/sherm1/followers","following_url":"https://api.github.com/users/sherm1/following{/other_user}","gists_url":"https://api.github.com/users/sherm1/gists{/gist_id}","starred_url":"https://api.github.com/users/sherm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sherm1/subscriptions","organizations_url":"https://api.github.com/users/sherm1/orgs","repos_url":"https://api.github.com/users/sherm1/repos","events_url":"https://api.github.com/users/sherm1/events{/privacy}","received_events_url":"https://api.github.com/users/sherm1/received_events","type":"User","site_admin":false},"created_at":"2016-08-16T06:56:59Z","updated_at":"2016-08-16T06:56:59Z","body":"I'm not opposed to utility methods if they solve real problems and don't create future maintenance agony. One advantage to a method like `HasFloatingRoot()` is that we can implement it expeditiously now but could convert it to an efficient implementation later if it proves necessary, without changes to user code. If we force user code to perform that operation we can't speed it up later.\r\n\r\nA few comments:\r\n- What does it mean for a model to have a pose? Is that something fixed that doesn't change or something state dependent?\r\n- For a minimally-sufficient API, there is no need to add a method for each orientation representation. Much better is to return a single standardized representation (rotation matrix or quaternion, say), with the orientation classes providing a minimally sufficient API for interconversion (e.g., rotation matrix to Euler angle sequence)."}}
{"actor":{"display_login":"sherm1"}}