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

Frame of Twist information for robot_localization

asked 2021-11-11 06:17:13 -0500

JadTaw gravatar image

updated 2021-11-11 07:33:12 -0500

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 flag offensive close merge delete

Comments

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

gvdhoorn gravatar image gvdhoorn  ( 2021-11-11 07:18:09 -0500 )edit

I will edit my question to clarify

JadTaw gravatar image JadTaw  ( 2021-11-11 07:28:48 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2021-11-11 20:41:41 -0500

Mike Scheutzow gravatar image

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

edit flag offensive delete link more
0

answered 2021-11-11 07:18:00 -0500

osilva gravatar image

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
# geometry_msgs/Point message instead.

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

edit flag offensive delete link more

Comments

I clarified my question

JadTaw gravatar image JadTaw  ( 2021-11-11 07:33:33 -0500 )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).
osilva gravatar image osilva  ( 2021-11-11 10:52:30 -0500 )edit

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

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-11-11 20:52:51 -0500 )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

osilva gravatar image osilva  ( 2021-11-12 03:18:24 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-11-11 06:17:13 -0500

Seen: 74 times

Last updated: Nov 11 '21