Ask Your Question

# What does Velocity in nav_msgs/Odometry actually mean?

I am confused with this type of data. What does the twist.twist.linear.x and twist.twist.linear.y actually represent?

I have a robot that can move either forward or backward and can ofcourse turn. In that case, doesn't the robot exhibit just velocity along X direction. Even if it turns, the robot's frame turns as well, still giving it a linear velocity along X direction. How come I am getting both X and Y velocity values here?

edit retag close merge delete

## 1 Answer

Sort by ยป oldest newest most voted

Your understanding is correct. For a differential drive robot, the odom.twist.twist.linear.y = 0 as it is referred to the base_link frame. The other part of the Odometry message though will include X and Y position in the Odom frame.

See this page where the to different frames are called out. http://docs.ros.org/api/nav_msgs/html...

As to why you are getting X and Y velocities, you'll have to provide some info on what your setup is.

.

more

## Comments

Thanks for your reply! I have a differential robot that follows a path. Child frame id is base_footprint. I am getting X,Y lin vel and Z for ang. vel . I need to trace the path in rviz, so I need to convert the velocity to distance and transform it to the world frame.

( 2016-07-04 14:49:02 -0500 )edit

Also in this tutorial, they seem to have taken both X and Y velocity for calculating the odometry

link text

( 2016-07-04 14:54:05 -0500 )edit

The tutorial does include a y velocity component, so I take it to mean that the simulated data (robot) is not for a differential drive, but perhaps a holonomic type. Can you post the code for the publisher of the odom? It shouldn't matter but is the robot real or simulated?

( 2016-07-05 00:29:35 -0500 )edit

Hey! I don't have the code though. But it is a real robot. I just have the rosbag file recorded. I guess, when the frame is in map frame, it will have both X and Y velocity. It can have just X velocity when the frame of reference is in robot's frame(base_footprint). What do you think?

( 2016-07-05 15:16:09 -0500 )edit

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2016-07-02 20:00:00 -0500

Seen: 809 times

Last updated: Jul 03 '16