Run this .launch in Gazebo

asked 2019-04-16 16:20:27 -0500

Dylan gravatar image

When I use my AR.Drone in real life, I use this .launch:

<launch>
        <arg name="droneip" default="192.168.1.1" />
        <node name="ardrone_driver" pkg="ardrone_autonomy" type="ardrone_driver" output="screen" args="-ip $(arg droneip)">
        <param name="navdata_demo" value="False" />
                <param name="realtime_navdata" value="True" />
                <param name="realtime_video" value="True" />
                <param name="looprate" value="30" />
        <param name="altitude_max" value="10000" />
        </node>
</launch>

But now I want to run that in Gazebo. I tried something like this:

<?xml version="1.0"?>
<launch>

  <env name="GAZEBO_MODEL_PATH" value="$(find qlab_gazebo):$(optenv GAZEBO_MODEL_PATH)"/>

  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="spawn_drone" default="true" />


  <arg name="droneip" default="192.168.1.1" />
  <node name="ardrone_driver" pkg="ardrone_autonomy" type="ardrone_driver" output="screen" args="-ip $(arg droneip)">
    <param name="navdata_demo" value="False" />
    <param name="realtime_navdata" value="True" />
    <param name="realtime_video" value="True" />
    <param name="looprate" value="30" />
  </node>


  <!-- start up world -->
  <include file="$(find qlab_gazebo)/launch/ardrone_sim_world.launch">
    <arg name="use_sim_time" value="$(arg use_sim_time)" />
    <arg name="gui" value="$(arg gui)" />
  </include>

  <!-- Spawn simulated quadrotor uav -->
  <include file="$(find qlab_gazebo)/launch/spawn_quadrotor.launch" >
    <arg name="model" value="$(find qlab_description)/urdf/quadrotor_sensors.urdf.xacro"/> 
  </include>
</launch>

But I think that the line arg name="droneip" default="192.168.1.1" is not OK, because Gazebo is running in my own computer. And when I run that, the simulation starts but then it prints:

Getting AR.Drone version ...

several times

edit retag flag offensive close merge delete