ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

Hi,

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:

<launch>

<!-- 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"/> 
</include>


</launch>

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

EDIT:

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="http://www.ros.org/wiki/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"/>
</xacro:r200_camera>

</robot>

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 
[/opt/ros/indigo/share/xacro/xacro.py 
/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)/xacro.py $(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

Comments

1

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
1

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

<launch>
  <!-- load model -->
  <param name="robot_description" command="$(find xacro)/xacro.py $(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"/>
</launch>

The run this launch file as

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

Comments

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

Question Tools

1 follower

Stats

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

Seen: 780 times

Last updated: Dec 31 '17