Ask Your Question

Difference (rotation?) between base_link and odom frame

asked 2011-04-05 06:57:09 -0500

hitesh gravatar image

Hi all, From the wiki, the robot is using a front-x, left-y coordinate convention. In rviz upon start, my robot faces in the front direction as the laser scan data is towards the forward direction. But when I give a goal, for example x = 1, y = 0 to frame base_link using simple_navigation_goals, which means it should move forward 1m, it is displayed 1m to the right of the robot on the odom (world) frame in rviz. In order to move the robot 1m forward, I have to give a y = 1, x = 0 goal. It seems the odom frame is following a x-right, y-front coordinate system. Is there a 90 degrees rotation between the two frames? This means that all velocities and distances reported by odometry have to be rotated 90 degrees clockwise? Or am I doing something wrong?

edit retag flag offensive close merge delete


Can you post some code or more information ?
Guido gravatar image Guido  ( 2011-04-05 19:42:47 -0500 )edit
An image about what you are seeing on rviz would be nice.
Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2011-04-05 21:15:39 -0500 )edit

3 Answers

Sort by » oldest newest most voted

answered 2011-04-06 05:34:21 -0500

Wim gravatar image

The odom frame is attached to the world. So as the robot drives around, it is going to be in a different position/orientation relative to the odom frame. On startup it just happens to be that the robot is turned 90 degrees relative to the odom frame, but this angle will change as the robot moves around.

The navigation goals you send to the robot are specified in the odom frame. So you tell the robot where to go in absolute world coordinates. It sounds like you want to command the robot in relative coordinates (move 1 meter forward from where ever the robot is right now). To do that, you have to convert the relative goals in absolute coordinates. Tf can help you do this.

edit flag offensive delete link more

answered 2011-04-05 21:14:34 -0500

I don't have an answer to your actual question (why setting a goal in the base_link frame doesn't work as expected), but some clarifications regarding the odom frame:

It seems the odom frame is following a x-right, y-front coordinate system. Is there a 90 degrees rotation between the two frames?

That changes over time. The idea is that if you set odom as your fixed frame in Rviz and move your robot, you should see your robot (base_link) moving around, according to the odometry information. So yes, if your robot turns by 90 degrees, there will be a 90 degrees rotation between those frames.

The current rotation/translation between odom and base_link is easy to verify by enabling the TF visualization in Rviz.

edit flag offensive delete link more

answered 2011-04-06 05:36:45 -0500

eitan gravatar image

I'll just add that you can give goals to the navigation stack in whatever frame you wish. If you always want to send goals relative to the robot's current position, using the "base_link" frame should be fine. Sending goals in a global frame like "odom" or "map" is normally the right thing to do when you have some specific position in the world you want the robot to move to.

Another thing is that the velocities reported by odometry are actually in the robot-centric, or "base_link" frame, so you don't actually have to rotate them to reason about them in that frame. The Odometry message is sort of funky in that way, but is documented here:

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2011-04-05 06:57:09 -0500

Seen: 2,596 times

Last updated: Apr 06 '11