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

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

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

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.

<launch>
  <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>

  <node pkg="diagnostic_aggregator" type="aggregator_node" name="diagnostic_aggregator" ns="qbot0_da">
    <rosparam command="load" file="$(find kobuki_node)/param/diagnostics.yaml" />
  </node>
</launch>

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 
/qbot0/mobile_base
/qbot0_da/diagnostic_aggregator
/qbot0_nm/mobile_base_nodelet_manager
/rosout

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
/diagnostics
/diagnostics_agg
/diagnostics_toplevel_state
/rosout
/rosout_agg

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

>> rostopic list
/diagnostics
/diagnostics_agg
/diagnostics_toplevel_state
/joint_states
/mobile_base/commands/controller_info
/mobile_base/commands/digital_output
/mobile_base/commands/external_power
/mobile_base/commands/led1
/mobile_base/commands/led2
/mobile_base/commands/motor_power
/mobile_base/commands/reset_odometry
/mobile_base/commands/sound
/mobile_base/commands/velocity
/mobile_base/controller_info
/mobile_base/debug/raw_control_command
/mobile_base/debug/raw_data_command
/mobile_base/debug/raw_data_stream
/mobile_base/events/bumper
/mobile_base/events/button
/mobile_base/events/cliff
/mobile_base/events/digital_input
/mobile_base/events/power_system
/mobile_base/events/robot_state
/mobile_base/events/wheel_drop
/mobile_base/sensors/core
/mobile_base/sensors/dock_ir
/mobile_base/sensors/imu_data
/mobile_base/sensors/imu_data_raw
/mobile_base/version_info
/mobile_base_nodelet_manager/bond
/odom
/rosout
/rosout_agg
/tf

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
0

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

gvdhoorn gravatar image

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

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.


Edit:

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

Comments

@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 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 252 times

Last updated: Mar 05 '19