ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This question was answered here

From the documentation in the vector message

This represents a vector in free space. It is only meant to represent a direction. Therefore, it does not make sense to apply a translation to it (e.g., when applying a generic rigid transformation to a Vector3, tf2 will only apply the rotation). If you want your data to be translatable too, use the geometry_msgs/Point message instead.

click to hide/show revision 2
No.2 Revision

This question was answered here

. Quoting to preserve the answer in case the link ever goes down:

Even though Point and Vector3 have the same content, the tf2 library checks the type of message and acts on it differently, depending on whether it is a Point or a Vector3.

Ultimately, this was a decision made by the developer to highlight the conceptual distinction between a Point (a point in space which cannot be rotated), and a Vector3 (a direction which has no definite location in space but which can be rotated).

The developer did not have to make this distinction, and in fact many physics libraries use a single Vector3 datatype to handle directions, points, velocities, etc.

As with Colors (red, green, blue) and Dates (year, month, day) and many other things which can be represented as a Vector3, ultimately it comes down to the need to draw artificial distinctions to make the code easier to understand for users and other programmers.

From the documentation in the vector message

This represents a vector in free space. It is only meant to represent a direction. Therefore, it does not make sense to apply a translation to it (e.g., when applying a generic rigid transformation to a Vector3, tf2 will only apply the rotation). If you want your data to be translatable too, use the geometry_msgs/Point message instead.