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

TurtleBot3 namespace issues (ROS1 Melodic)

asked 2021-12-09 06:56:32 -0500

WarTurtle gravatar image

updated 2021-12-09 07:11:16 -0500

Hello, I am trying to implement some code that works with multiple turtlebot3s in a gazebo simulation onto a real robot. The problem I am having is trying to create namespaces for each robot from a launch file. Currently just using the default turtlebot3 files to debug.

Following the instruction on this tutorial and writing this command on the robot:

ROS_NAMESPACE=Bot1 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="Bot1" set_lidar_frame_id:="Bot1/base_scan"

I get a nice output using rostopic list:


But when I try to write this to work in a launch file, as so:

  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_robot.launch">
    <arg name="multi_robot_name" value="Bot1"/>
    <arg name="set_lidar_frame_id" value="Bot1/base_scan"/>

I get the same outputs but without a namespace.


But if I run rostopic echo /odom, the frame_id and child_frame_id are "Bot1/odom" and "Bot1/base_footprint" respectively. So the namespace works, just not correctly?

Any help would be appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-12-09 08:12:15 -0500

Mike Scheutzow gravatar image

updated 2021-12-09 08:14:05 -0500

Those are not equivalent launch files, because you have not implemented the ROS_NAMESPACE=Bot1 part in the launch file. You want to look up how the <group ns="Bot1"> tag is used to modify the ros-node and topic names.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2021-12-09 06:56:32 -0500

Seen: 108 times

Last updated: Dec 09 '21