This repository was archived by the owner on Mar 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 480
Improve ROS and Gazebo documentation #393
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
80951e4
Add note that -v and -w can be useful for debugging
hamishwillee 20a0b16
Fix up minor typos in ROS text
hamishwillee 2459ffd
Replace previous installation instructions
hamishwillee 7d418f7
Move HITL to bottom simulation option - group SITL topics
hamishwillee dbbf96d
Improve ROS and Gazebo install text and introductions
hamishwillee 108d2ce
Move ROS simulation doc into ROS docs and cross link from gazebo docs
hamishwillee 8fb12b3
Updates to Gazebo Octomap doc
hamishwillee 6fa0b6f
Add note to MAVROS about extending to support RTPS
hamishwillee cd84278
Clarify ROS only supported on Linux
hamishwillee 8b5c8a7
Move/rename octomap topic to better associate with ROS
hamishwillee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| # Robotics using ROS | ||
|
|
||
| This section contains topics about using ROS (and offboard control) with PX4. | ||
| [ROS](http://www.ros.org/) (Robot Operating System) is a general purpose robotics library that can be used with PX4 for [offboard control](../ros/mavros_offboard.md). It uses the [MAVROS](../ros/mavros_installation.md) node to communicate with PX4 running on hardware or using the [Gazebo Simulator](../simulation/ros_interface.md). | ||
|
|
||
| This section contains topics about using ROS for offboard control with PX4. | ||
|
|
||
| > **Tip** ROS is only officially supported on Linux platforms. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,78 +1,73 @@ | ||
| # OctoMap | ||
| # OctoMap 3D Models with ROS/Gazebo | ||
|
|
||
| [The OctoMap library](http://octomap.github.io/) implements a 3D occupancy grid mapping approach. This guide covers the how to use it with [Rotors Simulator](https://github.com/ethz-asl/rotors_simulator/wiki/RotorS-Simulator). | ||
| The [OctoMap library](http://octomap.github.io/) is an open source library for generating volumetric 3D environment models from sensor data. This model data can then be used by a drone for navigation and obstacle avoidance. | ||
|
|
||
| This guide covers how to use *OctoMap* with the Gazebo [Rotors Simulator](https://github.com/ethz-asl/rotors_simulator/wiki/RotorS-Simulator) and ROS. | ||
|
|
||
| ## Installation | ||
|
|
||
| The installation requires to install ROS, Gazebo and the Rotors Simulator plugin. Follow the [instructions](https://github.com/ethz-asl/rotors_simulator) on Rotors Simulator to install. | ||
| The installation requires ROS, Gazebo and the Rotors Simulator plugin. Follow the [Rotors Simulator instructions](https://github.com/ethz-asl/rotors_simulator) to install. | ||
|
|
||
| Next, install The OctoMap library | ||
| <div class="host-code"></div> | ||
| Next, install the *OctoMap* library: | ||
| ```sh | ||
| sudo apt-get install ros-indigo-octomap ros-indigo-octomap-mapping | ||
| rosdep install octomap_mapping | ||
| rosmake octomap_mapping | ||
| sudo apt-get install ros-indigo-octomap ros-indigo-octomap-mapping | ||
| rosdep install octomap_mapping | ||
| rosmake octomap_mapping | ||
| ``` | ||
|
|
||
| Now, open ~/catkin_ws/src/rotors_simulator/rotors_gazebo/CMakeLists.txt and add the following lines to the bottom of the file | ||
| <div class="host-code"></div> | ||
| ```sh | ||
| find_package(octomap REQUIRED) | ||
| include_directories(${OCTOMAP_INCLUDE_DIRS}) | ||
| link_libraries(${OCTOMAP_LIBRARIES}) | ||
| find_package(octomap REQUIRED) | ||
| include_directories(${OCTOMAP_INCLUDE_DIRS}) | ||
| link_libraries(${OCTOMAP_LIBRARIES}) | ||
| ``` | ||
|
|
||
| Open ~/catkin_ws/src/rotors_simulator/rotors_gazebo/package.xml and add the following lines | ||
| <div class="host-code"></div> | ||
| ```sh | ||
| <build_depend>octomap</build_depend> | ||
| <run_depend>octomap</run_depend> | ||
| <build_depend>octomap</build_depend> | ||
| <run_depend>octomap</run_depend> | ||
| ``` | ||
|
|
||
| Run the following two lines. | ||
| Run the following two lines: | ||
|
|
||
| > **Note** The first line changes your default shell editor (which is vim by default) to gedit. This is recommended for users who have little experience with vim, but can otherwise be omitted. | ||
| > **Note** The first line changes your default shell editor to *gedit*. This is recommended for users who have little experience with *vim* (the default editor), but can otherwise be omitted. | ||
|
|
||
| <div class="host-code"></div> | ||
| ```sh | ||
| export EDITOR='gedit' | ||
| rosed octomap_server octomap_tracking_server.launch | ||
| export EDITOR='gedit' | ||
| rosed octomap_server octomap_tracking_server.launch | ||
| ``` | ||
| and change the two following lines | ||
| <div class="host-code"></div> | ||
| and change the two following lines: | ||
|
|
||
| ```sh | ||
| <param name="frame_id" type="string" value="map" /> | ||
| ... | ||
| <!--remap from="cloud_in" to="/rgbdslam/batch_clouds" /--> | ||
| <param name="frame_id" type="string" value="map" /> | ||
| ... | ||
| <!--remap from="cloud_in" to="/rgbdslam/batch_clouds" /--> | ||
| ``` | ||
| <div class="host-code"></div> | ||
| to | ||
|
|
||
| to: | ||
| ```sh | ||
| <param name="frame_id" type="string" value="world" /> | ||
| ... | ||
| <remap from="cloud_in" to="/firefly/vi_sensor/camera_depth/depth/points" /> | ||
| <param name="frame_id" type="string" value="world" /> | ||
| ... | ||
| <remap from="cloud_in" to="/firefly/vi_sensor/camera_depth/depth/points" /> | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## Running the Simulation | ||
|
|
||
| Now run the three following lines, in three separate terminal windows. This opens up Gazebo, Rviz and an octomap server. | ||
| Run the following three lines in *separate* terminal windows. This opens up [Gazebo](../simulation/gazebo.md), *Rviz* and an octomap server. | ||
|
|
||
| <div class="host-code"></div> | ||
| ```sh | ||
| roslaunch rotors_gazebo mav_hovering_example_with_vi_sensor.launch mav_name:=firefly | ||
| rviz | ||
| roslaunch octomap_server octomap_tracking_server.launch | ||
| roslaunch rotors_gazebo mav_hovering_example_with_vi_sensor.launch mav_name:=firefly | ||
| rviz | ||
| roslaunch octomap_server octomap_tracking_server.launch | ||
| ``` | ||
|
|
||
| In Rviz, change the field 'Fixed Frame' from 'map' to 'world' in the top left of the window. | ||
| In *Rviz*, change the field 'Fixed Frame' from 'map' to 'world' in the top left of the window. | ||
| Now click the add button in the bottom left and select MarkerArray. Then double click the MarkerArray and change 'Marker Topic' from '/free_cells_vis_array' to '/occupied_cells_vis_array' | ||
|
|
||
| Now you should see a part of the floor. | ||
|
|
||
| In the Gazebo window, insert a cube in front of the red rotors and you should see it in Rviz. | ||
|
|
||
| In the *Gazebo* window, insert a cube in front of the red rotors and you should see it in *Rviz*. | ||
|
|
||
|  | ||
|  | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fixing a typo - missing closing bracket