Ask Your Question
2

How to link odometry to a URDF model ?

asked 2011-03-09 21:36:13 -0500

So, I have my URDF model and I also am publishing a topic of type nav_msgs::Odometry. How do I link these together, such that the model moves within Rviz in accordance with the odometry position?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2011-03-09 22:16:27 -0500

raphael favier gravatar image

It's where TF comes handy:

A nav_msgs::Odometry is published within a certain frame (field frame_id). In the same time, your URDF model is also attached to some frame.

To make the robot move according to your odometry, you will need to produce a tf frame that describe where the robot is relative to the world. This transform correspond to the pose field of the odometry message.

Imagine you have a robot which main frame is "base_frame" and you are already producing an odometry message. Just produce a tf frame from "world" to "base_frame" that contains the pose values of your odometry message.

For more information and code example, see this tutorial.

Raph

edit flag offensive delete link more

Comments

Does this mean adding a "world" link and an "odom" joint to the URDF model ?
JediHamster gravatar imageJediHamster ( 2011-03-09 22:32:13 -0500 )edit
No. your URDF model only describes the aspect of your robot and is (if I am not wrong) linked to some frames of your robot. All you need to do is to publish a TF transform between the main frame of your robot (base_link in my example) and a frame that represent the reference of your odometry system (world in my example, odom in the tutorial).
raphael favier gravatar imageraphael favier ( 2011-03-09 22:47:26 -0500 )edit
Just as a precision. In my case, the only reason I am publishing a nav_msgs::Odometry message is to make my robot compatible with the navigation stack, which expects odometry information as nav_msgs::Odometry messages (see http://www.ros.org/wiki/navigation/Tutorials/RobotSetup?action=AttachFile&do=get&target=overview_tf.png) . Visualization in Rviz is purely based on the TF frames.
raphael favier gravatar imageraphael favier ( 2011-03-09 22:51:44 -0500 )edit
Ok, I think I've understood.
JediHamster gravatar imageJediHamster ( 2011-03-09 23:26:21 -0500 )edit

Your Answer

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

Add Answer

Question Tools

4 followers

Stats

Asked: 2011-03-09 21:36:13 -0500

Seen: 2,132 times

Last updated: Mar 09 '11