0
$\begingroup$

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.

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


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

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

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.


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.


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.

$\endgroup$

Your Answer

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