Multiple Turtlebots in Gazebo
Is it possible to separate the /cmd_vel and /odom topics when spawning multiple turtlebots in Gazebo?
My launch file looks like this:
<launch>
<param name="/use_sim_time" value="true" />
<node name="gazebo" pkg="gazebo" type="gazebo" args="-u $(find gazebo_worlds)/worlds/simple_office.world" respawn="false" output="screen"/>
<group ns="robot1">
<param name="robot_description" command="$(find xacro)/xacro.py '$(find turtlebot_description)/urdf/turtlebot.urdf.xacro'" />
<node name="spawn_turtlebot_model1" pkg="gazebo" type="spawn_model" args=" -urdf -param robot_description -namespace robo1 -x 0 -y 1 -model robo1" respawn="false" output="screen"/>
</group>
<param name="robot_description" command="$(find xacro)/xacro.py '$(find turtlebot_description)/urdf/turtlebot.urdf.xacro'" />
<node name="spawn_turtlebot_model2" pkg="gazebo" type="spawn_model" args=" -urdf -param robot_description -namespace robo2 -x 1 -y 1 -model robo2" respawn="false" output="screen"/>
<node name="spawn_turtlebot_model3" pkg="gazebo" type="spawn_model" args=" -urdf -param robot_description -namespace robo3 -x 1 -y -1 -model robo3" respawn="false" output="screen"/>
</launch>
and rostopic list looks like this:
/camera/camera_info
/camera/depth/points
/camera/image_raw
/camera/image_raw/compressed
/camera/image_raw/compressed/parameter_descriptions
/camera/image_raw/compressed/parameter_updates
/camera/image_raw/theora
/camera/image_raw/theora/parameter_descriptions
/camera/image_raw/theora/parameter_updates
/clock
/cmd_vel
/gazebo/link_states
/gazebo/model_states
/gazebo/paused
/gazebo/set_link_state
/gazebo/set_model_state
/joint_states
/odom
/robo1/depth/camera_info
/robo1/depth/image_raw
/robo1/imu/data
/robo1/scan
/robo1/set_hfov
/robo1/set_update_rate
/robo2/depth/camera_info
/robo2/depth/image_raw
/robo2/imu/data
/robo2/scan
/robo2/set_hfov
/robo2/set_update_rate
/robo3/depth/camera_info
/robo3/depth/image_raw
/robo3/imu/data
/robo3/scan
/robo3/set_hfov
/robo3/set_update_rate
/rosout
/rosout_agg
/tf
/turtlebot_node/sensor_state
With this setup I see 3 turtlebots in gazebo but get only one cmd_vel and odom topic so I can't control only them separately. I use natty with electric
Any ideas? Thank you very much
What nodes are generating your odom and cmd_vel messages?
Thanks Ryan, I tried your solution and changed line 36 to node_namespaceP_ = new ParamT<std::string>("robotNamespace","",0);
but the topics still are /odom and /cmd_vel. What else needs to be changed?
Did you test to see that passing in that renamed parameter via the URDF (gazebo.urdf.xacro) in turtlebot_description renames it correctly?
How do I do that? I'm not sure for what I have to look.
and when will you release the new version of the turtlebot simulator?
I actually tried to put in the xml file the robotNamespace parameter, but it is not detected... always cmd_vel..