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

Running multiple Kobuki bases in the same roscore by changing node names.

asked 2019-03-05 00:58:15 -0600

TharushiDeSilva gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-05 01:10:28 -0600

gvdhoorn gravatar image

updated 2019-03-05 04:28:28 -0600

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.

edit flag offensive delete link more


@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.

TharushiDeSilva gravatar image TharushiDeSilva  ( 2019-03-05 04:17:24 -0600 )edit

Question Tools

1 follower


Asked: 2019-03-05 00:55:14 -0600

Seen: 251 times

Last updated: Mar 05 '19