ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Drone Simulation using GMapping and Realsense R200

asked 2017-12-30 21:45:55 -0600

Andreluizfc gravatar image

updated 2017-12-31 16:15:38 -0600


I'd like to simulate the RTF Drone from Intel which has the R200 Camera as the main sensor. I'd like to use it for mapping simulations with GMapping. I want to build a launch file to load world, quadrotor_model, r200 camera and Gmapping in Gazebo in order to do some simulations. How can I create this costomized launch file?

I can't find a tutorial how to build customized launch files, so I'm trying some reverse engineering with the hector_quadrotor and turtlebot_gazebo packages. It's very confusing since I'm really new in ROS world.

Right now I have this:


<!-- Start Gazebo with wg world running in (max) realtime -->

<include file="$(find hector_gazebo_worlds)/launch/willow_garage.launch"/>

<!-- Spawn simulated quadrotor uav -->

<include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor.launch" >
<arg name="model" value="$(find hector_quadrotor_description)/urdf/quadrotor_with_kinect.xacro"/> 


I just found a drone model using kinect but would like to use the R200 camera.


I am trying to add the R200 camera model to quadrotor base. My quadrotor_with_r200.urdf.xacro file looks like this:

<?xml version="1.0"?>
<robot name="quadrotor" xmlns:xacro="">

<xacro:property name="M_PI" value="3.1415926535897931" />

<!-- Included URDF Files -->
<xacro:include filename="$(find hector_quadrotor_description)/urdf/quadrotor_base.urdf.xacro" />

<!-- Instantiate quadrotor_base_macro once (has no parameters atm) -->
<xacro:quadrotor_base_macro />

<!-- Intel R200 -->
<xacro:include filename="$(find drone_application)/urdf/r200_camera.urdf.xacro" />
<xacro:r200_camera name="camera" parent="base_link">
<origin xyz="0.05 0.0 -0.1" rpy="0 0 0"/>


Very similar to Hector quadrotor_with_kinect, but I get this erros when I try to run the launchfile:

xacro.XacroException: Invalid parameter "name" while expanding macro "xacro:r200_camera"
Invalid <param> tag: Cannot load command parameter [robot_description]: command 
/home/andre/catkin_ws/src/drone_application/urdf/quadrotor_with_r200.urdf.xacro myvar:=true] returned with 
code [1]. 

Param xml is <param command="$(find xacro)/ $(arg model) myvar:=true" name="robot_description"/>
The traceback for the exception was written to the log file
edit retag flag offensive close merge delete



What's your question?

jayess gravatar image jayess  ( 2017-12-30 21:56:15 -0600 )edit

How can I create a launch file to load in gazeebo a drone model, r200 camera and gmapping?

Andreluizfc gravatar image Andreluizfc  ( 2017-12-30 22:06:52 -0600 )edit

This update should probably be a new question but checkout the solution to #q127541

jayess gravatar image jayess  ( 2017-12-31 16:28:45 -0600 )edit

I could solve the problem, thanks a lot! Just removed the name="camera" in the quadrotor_with_r200.urdf.xacro.

Andreluizfc gravatar image Andreluizfc  ( 2018-01-02 18:09:57 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-12-30 22:33:40 -0600

jayess gravatar image

updated 2017-12-30 22:47:17 -0600

Check out the urdf tutorials and learn how urdf and xacro files work. Then, you can use this R200 xacro file to replace the kinect in the drone you found.

You can probably do this by using the quadrotor base xacro file in the hector_quadrotor_description package and adding that R200 xacro file that I linked to.

If you call this new file quadrotor_r200.xacro then you can load this into Gazebo by using a launch file (let's call it spawn_quadrotor.launch) similar to

  <!-- load model -->
  <param name="robot_description" command="$(find xacro)/ $(arg model) myvar:=true"/>
  <!-- Spawn a robot into Gazebo -->
  <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model quadrotor"/>

The run this launch file as

roslaunch my_package spawn_quadrotor.launch model:=/path/to/quadrotor_r200.xacro
edit flag offensive delete link more


Thanks a lot! I was trying to figure out those urdf and xacro files. Thanks for the R200 camera model. I'll definitely study them. Cheers!

Andreluizfc gravatar image Andreluizfc  ( 2017-12-30 22:48:03 -0600 )edit

No problem. If this solved your problem, please click the checkmark to mark the answer as correct.

jayess gravatar image jayess  ( 2017-12-30 22:58:32 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-12-30 21:45:55 -0600

Seen: 691 times

Last updated: Dec 31 '17