# Frame of Twist information for robot_localization

Hello,

If i am inputting a nav_msgs/Odometry from the wheel odometry into the robot_localization package, the nav_msgs/Odometry has pose information, and twist information.

I am only using the twist information in the robot_localization package.

The header.frame_id is odom, and the child_frame_id is base_footprint.

Since this is a planar robot, the twist field contains linear.x linear.y angular.z components.

My question is: In which frame are these three values expressed, in the child_frame_id, or in the header.frame_id.

For example, assuming the twist is in the frame of the child_frame_id, then if the robot has arbitrary orientation, and if the robot goes straight, vx will be non-zero, and all others zero. However, if the twist is in the frame of the header.frame_id (odom), then the orientation matters. For example, if the robot is aligned with the negative x-axis, and the robot goes straight, the vx will be negative. If the twist is expressed in the base_footprint frame, the vx will be positive.

So, robot_localization, which frame of reference does it expect the twist field to be expressed in?

edit retag close merge delete

Twist != Odom. Which of the two is it?

( 2021-11-11 07:18:09 -0600 )edit

I will edit my question to clarify

( 2021-11-11 07:28:48 -0600 )edit

Sort by » oldest newest most voted

For the Odometry message, the twist object velocities are the values relative to the child frame.

more

The Twist message type consists of a Linear Vector3 and Angular Vector3.

The Linear and Angular Vector3 represent 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


Reference: http://docs.ros.org/en/api/geometry_m...

more

I clarified my question

( 2021-11-11 07:33:33 -0600 )edit

Hi @JadTaw - thank you for the clarification and sorry if I am directly quoting, but I prefer to use the official documentation to show the explanation so it's not my interpretation: http://docs.ros.org/en/kinetic/api/ro...

**nav_msgs/Odometry** - All pose data (position and orientation) is transformed from the message header’s frame_id into the coordinate frame specified by the world_frame parameter (typically map or odom). In the message itself, this specifically refers to everything contained within the pose property. All twist data (linear and angular velocity) is transformed from the child_frame_id of the message into the coordinate frame specified by the base_link_frame parameter (typically base_link).

( 2021-11-11 10:52:30 -0600 )edit

@osilva I think the immediately above quote from the documentation is somewhere between wrong and puzzling.

( 2021-11-11 20:52:51 -0600 )edit

I don’t disagree with that Mike. I re-read it a few times and tried to find another documentation to explain. I don’t feel I am experienced enough to come on with my own explanation either

( 2021-11-12 03:18:24 -0600 )edit