roslaunch group ns doesn't work
Hello,
As far as I know, there is two ways to change topics in the launch file:
- using group ns (
<group ns="t1"> <node ..... > </group>
) - using remapping for node
I have tried both methods. But the first method is not always working. For example, I’ve tried to run the turtlebot3_teleop_key node within a group namespace. But still, it publishes to /cmd_vel topic. But when I use remapping, it works (publishes /t1/cmd_vel).
I want to know why sometimes using does not work, or what are the requirements?
this is my launch file (in noetic):
<launch>
<arg name="model" default="$(env TURTLEBOT3_MODEL)"/>
<arg name="name_space" default="t1"/>
<group ns = "$(arg name_space)">
<param name="model" value="$(arg model)"/>
<node pkg="turtlebot3_teleop" type="turtlebot3_teleop_key" name="turtlebot3_teleop" output="screen">
<!--remap from="/cmd_vel" to="/$(arg name_space)/cmd_vel"/-->
</node>
</group>
</launch>
If I comment remap part, it still publishes /cmd_vel topic, not /t1/cmd_vel
The group tag works as expected for me in melodic, and remaps to
/t1/cmd_vel
. Please edit your question to show us your launch file.