Multiple Ar.Drones on Tum_Simulator [closed]
I am trying to simulate multiple ArDrones on the tum simulator. Currently I am able to have two drones appear on the simulator but I cannot control them properly. I have named them firstAR and secondAR. In rostopic list, all of the correct topics appear except for takeoff, land and reset. The takeoff, land and reset and still under /ardrone/"". If I publish to this, the firstAR takes off forever.
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/empty.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="firstAR">
<!-- 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"/>
<arg name="Quad" value="firstAR"/>
</include>
</group>
<group ns="secondAR">
<!-- 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 2 -y 0 -z 0.5"/>
<arg name="Quad" value="secondAR"/>
</include>
</group>
<!-- Start rviz visualization with preset config -->
<node pkg="rviz" type="rviz" name="rviz" args="-d $(find cvg_sim_test)/rviz_cfg/outdoor_flight.vcg"/>
</launch>
Here is my spawn_quadrotor_classic file
<?xml version="1.0"?>
<launch>
<arg name="model" default="$(find cvg_sim_gazebo)/urdf/quadrotor.urdf.xacro"/>
<arg name="init_pose" />
<arg name="Quad" />
<!-- 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 $(arg Quad)"
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="$(arg Quad)" />
</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>
Thanks all who reply