multiple ar.drones on tum_simulator
Hello everyone. I've been trying to make the ros-gazebo simulator working with 2 or more drones, with no result. Using rostopic list, the topics appear with the right name (/ardrone/takeoff and /ardrone_2/takeoff etc.) but when I send a command, only one drones is receiving them, often with unexpected outcomes (it flies away =( ))
Here is my launch file,
<?xml version="1.0"?>
<launch>
<!-- Start Gazebo with wg world running in (max) realtime -->
<arg name="gui" default="true"/>
<param name="/use_sim_time" value="true" />
<node name="gazebo" pkg="gazebo" type="gazebo" args="$(find cvg_sim_gazebo)/worlds/3boxes_room.world" respawn="false" output="screen"/>
<!-- start gui -->
<group if="$(arg gui)">
<node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen" required="true"/>
</group>
<group ns="ardrone">
<!-- Spawn simulated quadrotor uav -->
<include file="$(find cvg_sim_gazebo)/launch/spawn_quadrotor_classic.launch" >
<arg name="model" value="$(find cvg_sim_gazebo)/urdf/quadrotor_sensors.urdf.xacro"/>
<arg name="init_pose" value="-x 0 -y 0 -z 0.5"
</include>
</group>
<group ns="ardrone_2">
<!-- Spawn simulated quadrotor uav -->
<include file="$(find cvg_sim_gazebo)/launch/spawn_quadrotor_classic.launch" >
<arg name="model" value="$(find cvg_sim_gazebo)/urdf/quadrotor_sensors.urdf.xacro"/>
<arg name="init_pose" value="-x 1 -y 0 -z 0.5"
</include>
</group>
</launch>
while the spawn_quadrotor_classic launch file is,
<launch>
<arg name="model" default="$(find cvg_sim_gazebo)/urdf/quadrotor.urdf.xacro"/>
<arg name="init_pose" />
<!-- send the robot XML to param server -->
<param name="robot_description" command="$(find xacro)/xacro.py '$(arg model)'" />
<!-- push robot_description to factory and spawn robot in gazebo -->
<node name="spawn_robot" pkg="gazebo" type="spawn_model"
args="-param robot_description
-urdf
$(arg init_pose)
-model quadrotor"
respawn="false" output="screen"/>
<!-- start robot state publisher -->
<node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher" output="screen" >
<param name="publish_frequency" type="double" value="50.0" />
<param name="tf_prefix" type="string" value="" />
</node>
<node name="ground_truth_to_tf" pkg="message_to_tf" type="message_to_tf" output="screen">
<param name="odometry_topic" value="ground_truth/state" />
<param name="frame_id" value="nav" />
</node>
<!-- node name="hector_pose_estimation" pkg="hector_pose_estimation" type="hector_pose_estimation_node" output="screen"/-->
</launch>
Any help would be appreciated! Thank you!
Related question (and answer): http://answers.gazebosim.org/question/896/name-dependent-plugin-topics/
I can recreate your error, but have not yet found a solution. Controlling two drones from one PC works irl, rostopics are correct.. it seems as if one simulated drone receives all commands based on the ground truth of the other drone (i.e. altd == 0, so go up).
Any news regarding this?