ros / common_msgs

Commonly used messages in ROS. Includes messages for actions (actionlib_msgs), diagnostics (diagnostic_msgs), geometric primitives (geometry_msgs), robot navigation (nav_msgs), and common sensors (sensor_msgs), such as laser range finders, cameras, point clouds.
http://wiki.ros.org/common_msgs
179 stars 191 forks source link

Add Point2D and Vector2 #121

Closed calvertdw closed 6 years ago

calvertdw commented 6 years ago

Is there a reason these aren't included?

More importantly, is there a reason why we shouldn't make these for ourselves and start using them in our API?

Is there an official place that they exist elsewhere?

tfoote commented 6 years ago

They are not provided because we generally recommend using 2 of the 3 dimensions of the 3 dimensional point. That way algorithms do not need to convert/provide dual interfaces for all things. If a component can only process elements in the plane it should have a policy for how to reduce a 3D point to 2D (usually project down) but in general we recommend making everything work with 3D coordinates.

For example if you have a navigation goal defined by a QR code. Most 2D planners will have a policy to project it down into the plane. However if I send you the navigation goal in the coordinate frame of the camera, which is tilted on it's side. It makes a lot more sense to project that into the coordinate frame of the base navigation plane, before navigating to the goal. However if the navigation goal was only expressed in 2 dimensions that would not be possible due to the missing information.

To make this simple use case work you'd have to communicate through a side channel what the coordinate frame is and how to project into it to every component before they can publish the goal which can lead to error buildup that's hard to correct if you have updated position estimates.