control multiple robots in gazebo
hello
at first, I could control one robot.
now, I could spawn multiple robot with same description in gazebo but I can't control them
one_robot.launch
<launch>
<arg name="robot_name"/>
<arg name="init_pose"/>
<node name="spawn_minibot_model" pkg="gazebo_ros" type="spawn_model"
args="$(arg init_pose) -sdf -param /robot_description -model $(arg robot_name)"
respawn="false" output="screen" />
<node pkg="robot_state_publisher" type="state_publisher"
name="robot_state_publisher" output="screen"/>
</launch>
robots.launch
<launch>
<group ns="robot1">
<param name="tf_prefix" value="robot1_tf" />
<include file="$(find maasndt_gazebo)/launch/one_robot.launch" >
<arg name="init_pose" value="-x 1 -y 1 -z 0" />
<arg name="robot_name" value="Robot1" />
</include>
</group>
<group ns="robot2">
<param name="tf_prefix" value="robot2_tf" />
<include file="$(find maasndt_gazebo)/launch/one_robot.launch" >
<arg name="init_pose" value="-x -1 -y 1 -z 0" />
<arg name="robot_name" value="Robot2" />
</include>
</group>
</launch>
maasndt_control.launch
<launch>
<rosparam file="$(find maasndt_control)/config/maasndt_control.yaml" command="load"/>
<node name="controller_spawner"
pkg="controller_manager"
type="spawner" respawn="false"
output="screen" ns="/maasndt"
args="joint_state_controller
LeftWheel_Motor RightWheel_Motor" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="false" output="screen">
</node>
</launch>
maasndt.launch
<launch>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find maasndt_gazebo)/worlds/maasndt.world"/>
</include>
<include file="$(find maasndt_gazebo)/launch/robots.launch"/> <include file="$(find maasndt_control)/launch/maasndt_control.launch"/>
</launch>
Thank you :)
Could you please format your launch file xml using the Preformatted text button on the toolbar (it's the one with
101010
on it)? Just select the text, and either press the button, orctrl+k
.format in done :)
Can you control one of them or none of them ? Do you have an error message ? What is in your maasndt_control.yaml file ?