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

Revision history [back]

click to hide/show revision 1
initial version

There appear to be errors in your RViz Displays panel. You should provide any errors/warnings when posting a question, but I'm guessing you have at least two problems:

  1. In your RViz window, it looks like you have an error with your fixed frame (map?). Try changing your fixed frame to one that you know exists, e.g., /rover1/base_link, or add a static transform from the fixed frame to your robot if nothing else is publishing that transfo. If you don't have a transform to each robot from some common frame, then you won't be able to see them all at once, though. A good way to check that you have all the transforms you need is to look at the output of rosrun rqt_tf_tree rqt_tf_tree.

  2. For the RobotModel display to work, you'll need to set its tf_prefix parameter appropriately for the corresponding robot. Without it, the display searches the global namespace and can't find the tf frames it needs (e.g., /base_link vs /rover1/base_link)

On a side note, I don't think the robot is upside-down in that RViz image; it's probably just placing separate components overlapped at the origin because it doesn't know how to "assemble" them properly (unknown transforms). That would also explain why it's just blank white.

There appear to be errors in your RViz Displays panel. You should provide any errors/warnings when posting a question, but I'm guessing you have at least two problems:

  1. In your RViz window, it looks like you have an error with your fixed frame (map?). Try changing your fixed frame to one that you know exists, e.g., /rover1/base_link, or add a static transform from the fixed frame to your robot if nothing else is publishing that transfo. If you don't have a transform to each robot from some common frame, then you won't be able to see them all at once, though. A good way to check that you have all the transforms you need is to look at the output of rosrun rqt_tf_tree rqt_tf_tree.

  2. For the RobotModel display to work, you'll need to set its tf_prefix parameter appropriately for the corresponding robot. Without it, the display searches the global namespace and can't find the tf frames it needs (e.g., /base_link vs /rover1/base_link)

On a side note, I don't think the robot is upside-down in that RViz image; it's probably just placing separate components overlapped at the origin because it doesn't know how to "assemble" them properly (unknown transforms). That would also explain why it's just blank white.


Follow-up Q&A

From all this what I have understood about tf is that it help translating between different coordinated frames right?

You are right, the tf tree tracks frame relationships (coordinate transforms) in ROS. The tf2 package allows developers to create and interact with the tree. Note that there is a an older tf package, but it uses tf2 under-the-hood now anyway.

Is there any good source on how these are generated and can be understood correctly.

Transforms and the tf tree can be confusing at first, but the tf2 wiki and tutorials definitely help.

Is there anyway that I can link all these transforms to /base_link and can visualize all robots at once.

You can link all your robots to an arbitrary frame with static transforms as mentioned in my answer above. RViz will be able to show you all three robots, but it's of limited use aside from testing. Also, I would choose a name other than /base_link for the common fixed frame, like /map or /world. Here's an explanation of standard names (REP-105).

What you probably want eventually is to use a SLAM package to find the transforms between each robot and a fixed world frame, e.g., /map. Then, the tf tree for each robot will be linked as one big tree, and RViz will be able to show them all in the same window. I recommend working through the Husarion tutorials if you haven't already. Multi-robot works the same as single-robot, but you have to take more care with the tf tree.

That brings me to one thing I noticed in the output graph of your tf tree (please, embed pictures when possible as links can break): there's only one odom -> base_link transform published by Gazebo. If you're simulating three robots, there should be three transforms. This is probably a matter of setting the correct namespace or tf_prefix in a launch or URDF file, but that goes beyond the scope of this question. If you think of more questions, or want clarification on any of these new questions, feel free to create a post for each specific question. That way we can keep ROS Answers more organized!