Assigning namespaces for topics from Kinect (Turtlebot)
Hi,
I am doing a simulation with 2 Turtlebots in Gazebo (using ROS Fuerte). I used different namespaces (turtle1 and turtle2) for each robot in order to get their respective data. However, I noticed that some of the topics (topics with Kinect info) did not change their names. For instance after using this snippet:
<group ns="turtle2">
<include file="$(find tortuninja)/launch/turtlebotNodes.launch" >
<arg name="model_name" value="turtle2" />
<arg name="x" value = "-2.0" />
</include>
</group>
Topics like /imu/data
would become accordingly /turtle2/imu/data
. But for others like /camera/depth/points
I would still get /camera/depth/points
.
I fixed the problem by editing the file ($find turtlebot_description)/urdf/gazebo.urdf.xacro
. I changed the global topic names like /camera/depth/points
to local ones camera/depth/points
. After doing that I was able to get the corresponding namespace in front (and get info from both Kinects).
My question is: Is this the right approach? Or is there any other way to change the namespace for Kinect-topics in Turtlebot other than editing the gazebo.urdf.xacro file
?
Thanks!
Ana
There is another way by remapping the global topic names. However as @joq said, your way is how it should be done.