Skip to content

Commit

Permalink
Add a simple Octomap scenario for the Crazyflie 2.0 #49
Browse files Browse the repository at this point in the history
  • Loading branch information
gsilano committed May 13, 2020
1 parent ace62a0 commit 0144abd
Show file tree
Hide file tree
Showing 12 changed files with 291 additions and 10 deletions.
2 changes: 1 addition & 1 deletion rotors_comm/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog for package rotors_comm
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.0.13 (2020-05-12)
4.0.13 (2020-05-13)
-------------------

4.0.12 (2020-05-02)
Expand Down
2 changes: 1 addition & 1 deletion rotors_control/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog for package rotors_control
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.0.13 (2020-05-12)
4.0.13 (2020-05-13)
-------------------

4.0.12 (2020-05-02)
Expand Down
2 changes: 1 addition & 1 deletion rotors_description/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog for package rotors_description
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.0.13 (2020-05-12)
4.0.13 (2020-05-13)
-------------------

4.0.12 (2020-05-02)
Expand Down
2 changes: 1 addition & 1 deletion rotors_evaluation/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog for package rotors_evaluation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.0.13 (2020-05-12)
4.0.13 (2020-05-13)
-------------------

4.0.12 (2020-05-02)
Expand Down
4 changes: 2 additions & 2 deletions rotors_gazebo/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Changelog for package rotors_gazebo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.0.13 (2020-05-12)
4.0.13 (2020-05-13)
-------------------
* Fixed issue related to the world file #50
* Add a simple scenario in which using the Octomap plugin with the Crazyflie 2.0
* Contributors: Giuseppe Silano

4.0.12 (2020-05-02)
Expand Down
89 changes: 89 additions & 0 deletions rotors_gazebo/launch/crazyflie2_octomap.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0"?>
<launch>
<arg name="mav_name" default="crazyflie2"/>
<!-- Pay attention that the world sampling time is line with the one used in the
controller algorithm-->
<arg name="world_name" default="octomap"/>
<arg name="enable_logging" default="false" />
<arg name="enable_ground_truth" default="true" />
<arg name="log_file" default="$(arg mav_name)" />
<arg name="paused" value="true"/>
<arg name="debug" default="false"/>
<arg name="gui" default="true"/>
<arg name="enable_vi_sensor" default="true"/>
<!-- The following line causes gzmsg and gzerr messages to be printed to the console
(even when Gazebo is started through roslaunch) -->
<arg name="verbose" default="false"/>
<!-- Enables the Internal Model Controller disabling the Mellinger and the Position ones -->
<arg name="enable_internal_model_controller" default="true"/>
<arg name="debug_rviz" default="false" />
<arg name="config" default="true" />
<arg unless="$(arg debug_rviz)" name="launch_prefix" value="" />
<arg if="$(arg debug_rviz)" name="launch_prefix" value="gdb --ex run --args" />
<arg unless="$(arg config)" name="command_args" value="" />
<arg if="$(arg config)" name="command_args" value="-d $(find rotors_gazebo)/rviz/crazyflie_octomap.rviz" />

<!-- The following lines simulate the world in Gazebo. The physic engine properties
are set up in the file "basic_crazyflie.world" file -->
<env name="GAZEBO_MODEL_PATH" value="${GAZEBO_MODEL_PATH}:$(find rotors_gazebo)/models"/>
<env name="GAZEBO_RESOURCE_PATH" value="${GAZEBO_RESOURCE_PATH}:$(find rotors_gazebo)/models"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find rotors_gazebo)/worlds/$(arg world_name)_crazyflie.world" />
<arg name="debug" value="$(arg debug)" />
<arg name="paused" value="$(arg paused)"/>
<arg name="gui" value="$(arg gui)" />
<arg name="verbose" value="$(arg verbose)"/>
</include>

<group ns="$(arg mav_name)">
<!-- The following lines simulate the Crazyflie dynamics -->
<include file="$(find rotors_gazebo)/launch/spawn_mav_crazyflie.launch">
<arg name="mav_name" value="$(arg mav_name)" />
<arg name="model" value="$(find rotors_description)/urdf/mav_generic_odometry_sensor.gazebo" />
<arg name="enable_logging" value="$(arg enable_logging)" />
<arg name="enable_ground_truth" value="$(arg enable_ground_truth)" />
<arg name="enable_vi_sensor" value="$(arg enable_vi_sensor)"/>
<!-- As for the Mellinger and Position controllers in the "crazyflie2_hovering_example.launch" file -->
<arg name="enable_internal_model_controller" value="$(arg enable_internal_model_controller)" />
<arg name="log_file" value="$(arg log_file)"/>
<arg name="x" value="-0.5"/>
</include>
<!-- The Crazyflie controller -->
<node name="position_controller_node" pkg="rotors_control" type="position_controller_node" output="screen">
<!-- Enabling internal model controller-->
<param name="enable_internal_model_controller" value="$(arg enable_internal_model_controller)" />
<!-- Crazyflie file parameters used within the Internal Model Controller controller -->
<rosparam command="load" file="$(find rotors_gazebo)/resource/crazyflie_parameters.yaml" />
<rosparam command="load" file="$(find rotors_gazebo)/resource/$(arg mav_name).yaml" />
<!-- Loading Internal Model Controller's parameters -->
<rosparam command="load" file="$(find rotors_gazebo)/resource/crazyflie_internal_model_controller.yaml" />
</node>
<!-- Enable/Disable the trajectory generator - If the position_controller is activated, the hovering_example will be executed,
otherwise the spline generator and the Mellinger's controller will be run-->
<node name="hovering_example_spline" pkg="rotors_gazebo" type="hovering_example_spline" output="screen" >
<rosparam command="load" file="$(find rotors_gazebo)/resource/spline_trajectory.yaml" />
</node>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
<node name="quaternion_to_rpy" pkg="rotors_gazebo" type="quaternion_to_rpy" output="screen" >
<remap from="odometry" to="odometry_sensor1/odometry" />
</node>

<!-- Octomap Server -->
<node pkg="octomap_server" type="octomap_server_node" name="octomap_server">
<param name="resolution" value="0.05" />
<param name="frame_id" type="string" value="world" />
<!-- maximum range to integrate (speedup!) -->
<param name="sensor_model/max_range" value="5.0" />
<param name="filter_ground" value="false" /> <!-- who knows where the floor is? -->
<param name="base_frame_id" value="base_link" /> <!-- needs to be set, even if not used -->
<!-- data source to integrate (PointCloud2) -->
<remap from="cloud_in" to="/$(arg mav_name)/vi_sensor/camera_depth/depth/points" />
</node>

<!-- Visualisation RVIZ -->
<node name="$(anon rviz)" launch-prefix="$(arg launch_prefix)" pkg="rviz" type="rviz" respawn="false"
args="$(arg command_args)" output="screen" />

</group>
</launch>
130 changes: 130 additions & 0 deletions rotors_gazebo/rviz/crazyflie_octomap.rviz
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
Panels:
- Class: rviz/Displays
Help Height: 78
Name: Displays
Property Tree Widget:
Expanded:
- /Global Options1
- /Status1
- /MarkerArray1
- /MarkerArray1/Status1
Splitter Ratio: 0.5
Tree Height: 728
- Class: rviz/Selection
Name: Selection
- Class: rviz/Tool Properties
Expanded:
- /2D Pose Estimate1
- /2D Nav Goal1
- /Publish Point1
Name: Tool Properties
Splitter Ratio: 0.5886790156364441
- Class: rviz/Views
Expanded:
- /Current View1
Name: Views
Splitter Ratio: 0.5
- Class: rviz/Time
Experimental: false
Name: Time
SyncMode: 0
SyncSource: ""
Preferences:
PromptSaveOnExit: true
Toolbars:
toolButtonStyle: 2
Visualization Manager:
Class: ""
Displays:
- Alpha: 0.5
Cell Size: 1
Class: rviz/Grid
Color: 160; 160; 164
Enabled: true
Line Style:
Line Width: 0.029999999329447746
Value: Lines
Name: Grid
Normal Cell Count: 0
Offset:
X: 0
Y: 0
Z: 0
Plane: XY
Plane Cell Count: 10
Reference Frame: <Fixed Frame>
Value: true
- Class: rviz/MarkerArray
Enabled: true
Marker Topic: /crazyflie2/occupied_cells_vis_array
Name: MarkerArray
Namespaces:
map: true
Queue Size: 100
Value: true
Enabled: true
Global Options:
Background Color: 48; 48; 48
Default Light: true
Fixed Frame: world
Frame Rate: 30
Name: root
Tools:
- Class: rviz/Interact
Hide Inactive Objects: true
- Class: rviz/MoveCamera
- Class: rviz/Select
- Class: rviz/FocusCamera
- Class: rviz/Measure
- Class: rviz/SetInitialPose
Theta std deviation: 0.2617993950843811
Topic: /initialpose
X std deviation: 0.5
Y std deviation: 0.5
- Class: rviz/SetGoal
Topic: /move_base_simple/goal
- Class: rviz/PublishPoint
Single click: true
Topic: /clicked_point
Value: true
Views:
Current:
Class: rviz/Orbit
Distance: 3.799877882003784
Enable Stereo Rendering:
Stereo Eye Separation: 0.05999999865889549
Stereo Focal Distance: 1
Swap Stereo Eyes: false
Value: false
Focal Point:
X: 0
Y: 0
Z: 0
Focal Shape Fixed Size: true
Focal Shape Size: 0.05000000074505806
Invert Z Axis: false
Name: Current View
Near Clip Distance: 0.009999999776482582
Pitch: 0.785398006439209
Target Frame: <Fixed Frame>
Value: Orbit (rviz)
Yaw: 0.785398006439209
Saved: ~
Window Geometry:
Displays:
collapsed: false
Height: 1025
Hide Left Dock: false
Hide Right Dock: false
QMainWindow State: 000000ff00000000fd00000004000000000000015600000363fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000363000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000363fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d00000363000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073d0000003efc0100000002fb0000000800540069006d006501000000000000073d000002eb00fffffffb0000000800540069006d00650100000000000004500000000000000000000004cc0000036300000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Selection:
collapsed: false
Time:
collapsed: false
Tool Properties:
collapsed: false
Views:
collapsed: false
Width: 1853
X: 67
Y: 27
62 changes: 62 additions & 0 deletions rotors_gazebo/worlds/octomap_crazyflie.world
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" ?>
<?xml-model href="http://sdformat.org/schemas/root.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<sdf version="1.4">
<world name="default">
<include>
<uri>model://ground_plane</uri>
</include>
<include>
<uri>model://sun</uri>
</include>
<include>
<uri>model://small_box</uri>
</include>

<!-- Only one ROS interface plugin is required per world, as any other plugin can connect a Gazebo
topic to a ROS topic (or vise versa). -->
<plugin name="ros_interface_plugin" filename="librotors_gazebo_ros_interface_plugin.so"/>

<!-- coordinate system {-->
<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
<latitude_deg>47.3667</latitude_deg>
<longitude_deg>8.5500</longitude_deg>
<elevation>500.0</elevation>
<heading_deg>0</heading_deg>
</spherical_coordinates>
<!--}-->

<!-- physics engine {-->
<physics name="default_physics" default="0" type='ode'>
<ode>
<solver>
<type>quick</type>
<iters>1000</iters>
<sor>1.3</sor>
</solver>
<constraints>
<cfm>0</cfm>
<erp>0.2</erp>
<contact_max_correcting_vel>100</contact_max_correcting_vel>
<contact_surface_layer>0.001</contact_surface_layer>
</constraints>
</ode>
<max_step_size>0.001</max_step_size>
<real_time_factor>1</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
<magnetic_field>6.0e-06 2.3e-05 -4.2e-05</magnetic_field>
<gravity>0 0 -9.8</gravity>
</physics>
<!--}-->

<!-- turn off shadows {-->
<scene>
<shadows>false</shadows>
<sky>
<clouds/>
</sky>
</scene>
<!--}-->

</world>
</sdf>
2 changes: 1 addition & 1 deletion rotors_gazebo_plugins/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog for package rotors_gazebo_plugins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.0.13 (2020-05-12)
4.0.13 (2020-05-13)
-------------------

4.0.12 (2020-05-02)
Expand Down
2 changes: 1 addition & 1 deletion rotors_joy_interface/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog for package rotors_joy_interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.0.13 (2020-05-12)
4.0.13 (2020-05-13)
-------------------

4.0.12 (2020-05-02)
Expand Down
2 changes: 1 addition & 1 deletion rotors_simulator/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog for package rotors_simulator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.0.13 (2020-05-12)
4.0.13 (2020-05-13)
-------------------

4.0.12 (2020-05-02)
Expand Down
2 changes: 1 addition & 1 deletion rqt_rotors/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog for package rqt_rotors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4.0.13 (2020-05-12)
4.0.13 (2020-05-13)
-------------------

4.0.12 (2020-05-02)
Expand Down

0 comments on commit 0144abd

Please sign in to comment.