0
$\begingroup$

Rosanswers logo

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!


Originally posted by jacky_90 on ROS Answers with karma: 101 on 2013-05-17

Post score: 3


Original comments

Comment by aukejw on 2013-05-31:
Related question (and answer): http://answers.gazebosim.org/question/896/name-dependent-plugin-topics/

Comment by aukejw on 2013-05-31:
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).

Comment by alfa_80 on 2014-05-07:
Any news regarding this?

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

We had multiple (4) quadrotors flying using hector_quadrotor (which tum_simulator is based off) in ROS fuerte and groovy. I think that setup was using tf_prefix, which is not supported anymore with hydro, though. In principle it´s possible to get multiple UAVs working in Gazebo simulation, but making it work will probably require some effort.


Originally posted by Stefan Kohlbrecher with karma: 24361 on 2014-05-08

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Yonggun Lee on 2014-06-12:
can you send me how you did more detail to my email please? [email protected] I also wonder if it also can work with tum_simulator in ROS fuerte

Comment by Humberto Beltrao on 2014-10-29:
Could you also send me how this ros-multiple-uav-control is made? I'm using hector_quadrtor and facing the same issue.

Comment by ahendrix on 2014-10-29:
Please try to keep the discussion on the answers.ros.org site, where it can benefit the entire community.

Comment by malharjajoo on 2018-02-03:
Hi, anyone found the solution to this ??

$\endgroup$
0
$\begingroup$

Rosanswers logo

Something new?? I have the same problem...


Originally posted by David Saldana with karma: 3 on 2013-06-28

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

I contacted the developer some time ago. He said that the simulator is structured in such a way that allows the spawning of only a single robot at each time.


Originally posted by jacky_90 with karma: 101 on 2014-05-07

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.