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

Revision history [back]

click to hide/show revision 1
initial version

Using roslaunch to rename nodes should work, and is the correct way to do this.

The sample launch file that you posted appears to have a typo (both lines are the same)

You can put each node in a separate namespace:

<node ns="copter" pkg="mavros" type="mavros_node" name="mavros"/>
<node ns="rover" pkg="mavros" type="mavros_node" name="mavros"/>

Or you can avoid namespaces and just give them different names:

<node pkg="mavros" type="mavros_node" name="mavros_copter"/>
<node pkg="mavros" type="mavros_node" name="mavros_rover"/>

Using roslaunch to rename nodes should work, and is the correct way to do this.

The sample launch file that you posted appears to have a typo (both lines are the same)

You can put each node in a separate namespace:

<node ns="copter" pkg="mavros" type="mavros_node" name="mavros"/>
<node ns="rover" pkg="mavros" type="mavros_node" name="mavros"/>

Or you can avoid namespaces and just give them different names:

<node pkg="mavros" type="mavros_node" name="mavros_copter"/>
<node pkg="mavros" type="mavros_node" name="mavros_rover"/>

If you're using <include> tags in roslaunch, you can also push all of the nodes in that launch file into a namespace with the ns parameter:

<include ns="copter" file="$(find mavros)/launch/node.launch">
  <arg name="pluginlists_yaml" value="$(find mavros)/launch/apm_pluginlists.yaml" />
  <arg name="config_yaml" value="$(find mavros)/launch/apm_config.yaml" />
  <arg name="fcu_url" value="$(arg fcu_url/copter)" />
  <arg name="gcs_url" value="$(arg gcs_url/copter)" />
  <arg name="tgt_system" value="$(arg tgt_system/copter)" />
  <arg name="tgt_component" value="$(arg tgt_component/copter)" />
  <arg name="log_output" value="$(arg log_output/copter)" />
</include>

<include ns="rover" file="$(find mavros)/launch/node.launch">
  <arg name="pluginlists_yaml" value="$(find mavros)/launch/apm_pluginlists.yaml" />
  <arg name="config_yaml" value="$(find mavros)/launch/apm_config.yaml" />
  <arg name="fcu_url" value="$(arg fcu_url/rover)" />
  <arg name="gcs_url" value="$(arg gcs_url/rover)" />
  <arg name="tgt_system" value="$(arg tgt_system/rover)" />
  <arg name="tgt_component" value="$(arg tgt_component/rover)" />
  <arg name="log_output" value="$(arg log_output/rover)" />
</include>