Adding a namespace to robot frames
I am running multiple qbots in a multi-master network, and I have been able to successfully run individual robot topics under a given namespace. (eg: qbot1/mobile_base/commands/ .... , qbot2/mobile_base/commands/... etc). But my robots still run under the default frame names defined by the system, so every robot has the same frame names. For example, this is my TF tree for qbot0:
My expectation is to remap these frames as,
odom -> qbot0/odom
base_footprint -> qbot0/base_footprint
camera_link -> qbot0/camera_link
base_link -> qbot0/base_link etc.
So that, when I run two robots in the system, I can visualize two separate trees. (one tree per robot) I use the following launch file with the standard kobuki, and freenect drivers.
<launch>
<group ns="qbot0">
<!-- run kobuki base -->
<include file="$(find kobuki_node)/launch/minimal.launch"/>
<!-- tf config -->
<param name="tf_prefix" value="qbot0" />
<node pkg="tf" type="static_transform_publisher" name="camera_to_base" args="0 0 0.1 0 0.0 0 base_footprint camera_link 100"/>
<node pkg="tf" type="static_transform_publisher" name="robot_state_publisher" args="0 0 0 0 0.0 0 base_footprint base_link 100"/>
<!-- run kinect -->
<include file="$(find freenect_launch)/launch/freenect.launch" />
</group>
</launch>
I get the following results when I run tf_monitor command.
Frames:
Frame: /camera_depth_frame published by unknown_publisher(static) Average Delay: 0 Max Delay: 0
Frame: /camera_depth_optical_frame published by unknown_publisher(static) Average Delay: 0 Max Delay: 0
Frame: /camera_rgb_frame published by unknown_publisher(static) Average Delay: 0 Max Delay: 0
Frame: /camera_rgb_optical_frame published by unknown_publisher(static) Average Delay: 0 Max Delay: 0
Frame: base_footprint published by unknown_publisher Average Delay: 0.000201064 Max Delay: 0.00149896
Frame: base_link published by unknown_publisher Average Delay: -0.0998057 Max Delay: 0
Frame: camera_link published by unknown_publisher Average Delay: -0.0998314 Max Delay: 0
I have no luck with the tf_prefix parameter. I wish to know a few thing if you are familiar with libraries like freenect and tf.
- What am I doing wrong with the tf_prefix parameter?
- Is there a way to debug the TF in more advanced manner s.t. I can find by whom the frames are actually being published?
- How can I accurately add the prefix in front of all the robot frames?