Setting up the tf tree for multiple robots [closed]
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?