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

Setting up the tf tree for multiple robots [closed]

asked 2013-02-15 02:34:55 -0500

Claudio gravatar image

There seem to be a great many "silently overlooked" aspects of getting multiple robots to work correctly.

At this page I read that each robot (nodes) should be run with the correct tf_prefix, so I did that and after a lot of fiddling it seems to be working. But it's still completely disregarding the tf publisher in my code that is supposed to publish the transform of position of the robot's base.

My code does the following:

transform.setOrigin( tf::Vector3(robot_state[0]/100, robot_state[1]/100, 0.0) );
transform.setRotation( tf::Quaternion(0, 0, robot_state[3]) );
br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "world", "base_link"));

which appears correct to me. Yet nothing moves. The tf tree shows just two tfs: base_link and laser. And they are connected by a static broadcaster (as the laser is fixed relative to the robot). My code broadcaster is not detected and moreover there is no "world" tf.

But I figure that if I put in a static broadcaster from world to base_link, my base_link wouldn't be able to move then.

So how should I do it?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Claudio
close date 2013-02-15 04:11:25

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-02-15 03:48:47 -0500

The base_link of the robot should be defined in /odom frame. And /odom should be defined in either world/map. So if using a standard mobile platform like turtlebot or Pioneer the frame /odom is published itself. Like you said for using multiple robots you have to tf_prefix. And all the robots should be defined w.r.t frame which is common between them like map or world.

Try using tf_echo between world and base_link to confirm whether tf is getting published or not.

Hope this helps..

edit flag offensive delete link more

Comments

Well guess what...

My code wasn't beeing executed... I fiddled to get the config right, and now I have it. Thanks!

Claudio gravatar image Claudio  ( 2013-02-15 04:11:13 -0500 )edit

Question Tools

Stats

Asked: 2013-02-15 02:34:55 -0500

Seen: 1,522 times

Last updated: Feb 15 '13