Add 2 ardrone to gazebo

asked 2015-06-12 06:11:29 -0600

Tal gravatar image

I want to add 2 or more ardrone model to gazebo to work simulations.
I have ros indigo, and i am using this simulation for ardrone.
I am using this simulation: tum_simulator indigo.
I have this lanchfile:
file robots.launch

<launch>
<arg name="world_name" default="cafe.world"/>
    <!-- start gazebo -->
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="use_sim_time" value="true"/>
        <arg name="debug" value="false"/>
        <arg name="world_name" value="$(find gtsam_infrastructure)/gazebo_worlds/$(arg world_name)"/>
    </include>
   <!-- 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>
    <group ns="quad1">
        <!-- Spawn simulated quadrotor uav -->
        <include file="$(find gtsam_infrastructure)/launch/spawn_quadrotor.launch" >
            <arg name="model" value="$(find cvg_sim_gazebo)/urdf/quadrotor_sensors.urdf.xacro"/>
        </include>
    </group>
</launch>

file spawn_quadrotor.launch

<?xml version="1.0"?>
<launch>
    <arg name="model" default="$(find cvg_sim_gazebo)/urdf/quadrotor.urdf.xacro"/>
    <arg name="x" default="0"/>
    <arg name="y" default="0"/>
    <arg name="z" default="0.5"/>
    <arg name="R" default="0"/>
    <arg name="P" default="0"/>
    <arg name="Y" default="0"/>
    <!-- send the robot XML to param server -->
    <param name="robot_description2" command="$(find xacro)/xacro.py '$(arg model)'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->
    <node name="spawn_robot" pkg="gazebo_ros" type="spawn_model"
            args="-param robot_description2
            -urdf
            -x '$(arg x)'
            -y '$(arg y)'
            -z '$(arg z)'
            -R '$(arg R)'
            -P '$(arg P)'
            -Y '$(arg Y)'
            -model quadrotor"
            respawn="false" output="screen"/>

    <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>

when i start this simulation, i have this topics:

/quad1/altimeter
/quad1/ardrone/bottom/parameter_descriptions
/quad1/ardrone/bottom/parameter_updates
/quad1/ardrone/front/parameter_descriptions
/quad1/ardrone/front/parameter_updates
/quad1/ardrone/imu
/quad1/cmd_vel
/quad1/fix
/quad1/fix_velocity
/quad1/ground_truth/state
/quad1/magnetic
/quad1/pressure_height
/quad1/sonar_height

/ardrone/bottom/camera_info
/ardrone/bottom/image_raw
/ardrone/bottom/image_raw/compressed
/ardrone/bottom/image_raw/compressed/parameter_descriptions
/ardrone/bottom/image_raw/compressed/parameter_updates
/ardrone/bottom/image_raw/compressedDepth
/ardrone/bottom/image_raw/compressedDepth/parameter_descriptions
/ardrone/bottom/image_raw/compressedDepth/parameter_updates
/ardrone/bottom/image_raw/theora
/ardrone/bottom/image_raw/theora/parameter_descriptions
/ardrone/bottom/image_raw/theora/parameter_updates
/ardrone/camera_info
/ardrone/front/camera_info
/ardrone/front/image_raw
/ardrone/front/image_raw/compressed
/ardrone/front/image_raw/compressed/parameter_descriptions
/ardrone/front/image_raw/compressed/parameter_updates
/ardrone/front/image_raw/compressedDepth
/ardrone/front/image_raw/compressedDepth/parameter_descriptions
/ardrone/front/image_raw/compressedDepth/parameter_updates
/ardrone/front/image_raw/theora
/ardrone/front/image_raw/theora/parameter_descriptions
/ardrone/front/image_raw/theora/parameter_updates
/ardrone/image_raw
/ardrone/image_raw/compressed
/ardrone/image_raw/compressed/parameter_descriptions
/ardrone/image_raw/compressed/parameter_updates
/ardrone/image_raw/compressedDepth
/ardrone/image_raw/compressedDepth/parameter_descriptions
/ardrone/image_raw/compressedDepth/parameter_updates
/ardrone/image_raw/theora
/ardrone/image_raw/theora/parameter_descriptions
/ardrone/image_raw/theora/parameter_updates
/ardrone/imu
/ardrone/land
/ardrone/navdata
/ardrone/reset
/ardrone/takeoff

and I want to be able to remap all the all the topic that start with /ardrone to /quad1/ardrone Already try:

  1. add <group ns="quad1"> </group> to spawn_quadrotor.launch
  2. add <remap from="ardrone/takeoff" to="/quad1/ardrone/takeoff"/> to ...
(more)
edit retag flag offensive close merge delete

Comments

Did you manage to solve this problem? I am trying to do the same thing in kinetic+gazebo7 and I'm facing the same problem

tradeA gravatar imagetradeA ( 2018-01-17 14:35:41 -0600 )edit