0
$\begingroup$

Rosanswers logo

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?


Originally posted by Claudio on ROS Answers with karma: 859 on 2013-02-15

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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..


Originally posted by ayush_dewan with karma: 1610 on 2013-02-15

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Claudio on 2013-02-15:
Well guess what...

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.