Unable to move multiple turtlebots
EDIT: PROBLEM SOLVED, thanks anyway
Hello,
I want to launch multiple turtlebots using Gazebo, and move each one from them separately with cmd_vel_mux
topic. Namely, I would like to send message to topic {robot_name)/cmd_vel_mux
. However, I have just publishers to these topics in my code (because I have code that each robot runs that publishers to this topic). But, I have no subscribers to these topics. Therefore, gazebo is launched but the robots doesn't move.
I tried to launch mobile_base_nodelet_manager
from ros nodelet package for each robot by adding to each robot launch file:
<node name="mobile_base_nodelet_manager" pkg="nodelet" type="nodelet" args="manager"/>
but I still didn't see subscribers to {robot_name}/cmd_vel_mux
topics.
My files: MultipleRobot.launch
<?xml version="1.0"?>
<launch>
<param name="/use_sim_time" value="true" />
<!-- start world -->
<include file="$(find turtlebot_gazebo)/launch/turtlebot_world.launch">
<arg name="world_file" value="$(find turtlebot_gazebo)/worlds/corridor.world"/>
<!-- include our robots -->
<include file="$(find stopper)/launch/robots.launch"/>
</include>
</launch>
robot.launch
<?xml version="1.0"?>
<launch>
<!-- BEGIN ROBOT 1-->
<group ns="robot1">
<param name="tf_prefix" value="robot1" />
<include file="$(find stopper)/launch/one_robot.launch" >
<arg name="init_pose" value="-x 1 -y 1 -z 0" />
<arg name="robot_name" value="robot1" />
</include>
</group>
<!-- BEGIN ROBOT 2-->
<group ns="robot2">
<param name="tf_prefix" value="robot2" />
<include file="$(find stopper)/launch/one_robot.launch" >
<arg name="init_pose" value="-x -1 -y 1 -z 0" />
<arg name="robot_name" value="robot2" />
</include>
</group>
</launch>
one_robot.launch
<?xml version="1.0"?>
<launch>
<arg name="robot_name"/>
<arg name="init_pose"/>
<!-- Launch stopper node -->
<node name="stopper" pkg="stopper" type="stopper" output="screen" args="$(arg robot_name)">
</node>
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="$(arg init_pose) -urdf -param
robot_description -model $(arg robot_name)" output="screen"/>
<node name="mobile_base_nodelet_manager" pkg="nodelet" type="nodelet" args="manager"/>
</launch>
How can I solve this? Thanks in advance!
Can you please update your question with your launch file(s)?
@jayess, Updated.
@jayess, Can you advice me how to solve this? Thanks
@moni213, if you've solved your question can you please post your solution as an answer?