Rosanswers logo

Hi! I need to run two Qbot2s (Kobuki bases) within the same network using ROS Kinetic distro. I have figured out that I need to launch them with different node names. So I edited my kobuki/kobuki_node/launch/minimal.launch file by giving name spaces for the nodes.

  <arg name="kobuki_publish_tf" default="true"/> 

  <node pkg="nodelet" type="nodelet" name="mobile_base_nodelet_manager" ns="qbot0_nm" args="manager"/>
  <node pkg="nodelet" type="nodelet" name="mobile_base" ns="qbot0" args="load kobuki_node/KobukiNodelet mobile_base_nodelet_manager">
    <rosparam file="$(find kobuki_node)/param/base.yaml" command="load"/>
    <param name="publish_tf" value="$(arg kobuki_publish_tf)"/>
    <remap from="mobile_base/odom" to="odom"/>
    <remap from="mobile_base/joint_states" to="joint_states"/>
  <node pkg="diagnostic_aggregator" type="aggregator_node" name="diagnostic_aggregator" ns="qbot0_da">
    <rosparam command="load" file="$(find kobuki_node)/param/diagnostics.yaml" />

Here I have given namespace parameter for all three nodes available. When I launch the given file, I can see the nodes registered with new names.

>> rosnode list 

But when I look at the rostopic list, I still cannot see the topics relevant to Kobuki base (eg: odom, joint_states etc. ). Here is my rostopic list,

>> rostopic list

This is the structure of the rostopic list I should be getting, (generated by using the original launch file)

>> rostopic list

I have an intuition that I need to map the new node names with expected topics, but I do not know how to. Can you help me identify the way I should so this task? Thanks in advance.

Originally posted by TharushiDeSilva on ROS Answers with karma: 79 on 2019-03-05

Post score: 0


1 Answer 1


Rosanswers logo

You'll need to run the entire launch file in a namespace. Look into ROS_NAMESPACE or (probably preferred): create a new launch file that uses the ns attribute on three include tags.

There's also quite a few "multiple turtlebot" posts here on ROS Answers. I'd recommend to take a look at those.


I included the whole content of the launch file under the required namespace.

just making sure: the include tag supports the ns attribute, so you can "push down" entire launch files (and their includes) into namespaces easily that way. There is no need to do that manually.

Originally posted by gvdhoorn with karma: 86574 on 2019-03-05

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by TharushiDeSilva on 2019-03-05:
@gvdhoorn, Thank you so much for your comment. I looked into some turtlebot answers, and as you mentioned, I included the whole content of the launch file under the required namespace. Then It worked!! Thanks again.


Your Answer

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