TurtleBot3 namespace issues (ROS1 Melodic)
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
:
/Bot1/battery_state
/Bot1/cmd_vel
/Bot1/cmd_vel_rc100
/Bot1/diagnostics
/Bot1/firmware_version
/Bot1/imu
/Bot1/joint_states
/Bot1/magnetic_field
/Bot1/motor_power
/Bot1/odom
/Bot1/reset
/Bot1/rpms
/Bot1/scan
/Bot1/sensor_state
/Bot1/sound
/Bot1/version_info
/diagnostics
/rosout
/rosout_agg
/tf
But when I try to write this to work in a launch file, as so:
<launch>
<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"/>
</include>
</launch>
I get the same outputs but without a namespace.
/battery_state
/cmd_vel
/cmd_vel_rc100
/diagnostics
/firmware_version
/imu
/joint_states
/magnetic_field
/motor_power
/odom
/reset
/rosout
/rosout_agg
/rpms
/scan
/sensor_state
/sound
/tf
/version_info
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.