Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ardupilot_ros: turn it into a ros 2 package #6

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 0 additions & 206 deletions CMakeLists.txt

This file was deleted.

91 changes: 29 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,40 @@
# ardupilot_ros package for non-gps navigation

## Description :
This is a ROS package for non-gps navigation for ardupilot containing all the required files and listed dependencies. This also contains a file from [thien94/vision_to_mavros](https://github.com/thien94/vision_to_mavros) to set origin.

Detailed description of the project and setup: [Ardupilot Docs - Cartographer](https://ardupilot.org/dev/docs/ros-cartographer-slam.html)

This package contains all the modified files for the following packages:
````
mavros
cartographer_ros
robot_pose_publisher
navigation
````

ap_navigation: https://github.com/ArduPilot/companion/tree/master/Common/ROS/ap_navigation

Important PRs: https://github.com/mavlink/mavros/pull/1780

# ardupilot_ros: ROS 2 use cases with Ardupilot

## Requirements :
Ubuntu version 18.04 or 20.04

ROS Melodic or Noetic

## Usage 1 :

On the ardupilot latest stable, run:
* [ROS Humble](https://docs.ros.org/en/humble/Installation.html)

````
source ~/ardupilot/Tools/environment_install/install-ROS-ubuntu.sh
````
This will install the whole ardupilot-ros environment and install all the requirements.
* [Gazebo Garden](https://gazebosim.org/docs/garden/install)

## Usage 2 :
* [ardupilot_gz](https://github.com/ArduPilot/ardupilot_gz)
* Here are two workarounds for know issues in the installation of `ardupilot_gz` (they should be fixed soon)
* [Handle microxrceddsgen dependency](https://github.com/ArduPilot/ardupilot_gz/issues/19)
* Set the ENABLE_DDS ardupilot parameter manually if it isn't set

This package contains a main launch file launching all the required launch files in a go.
## Instalation

Simply,
Clone this repository into your ros2 workspace alongside ardupilot_gz
```bash
cd ~/ros2_ws/src
git clone [email protected]:pedro-fuoco/ardupilot_ros.git -b ros2-package
```
Build it with colcon build
```bash
cd ~/ros2_ws
source install/setup.sh
colcon build --packages-select ardupilot_ros
```

````
cd <ros_ws>/src/
git clone https://github.com/snktshrma/ardupilot_ros
cd ..
rosdep install --from-paths src --ignore-src -r -y
cd ardupilot_ros
catkin build
````
## Usage

## Run :
### 1. Cartographer running with lidar on copter

### On 1st Terminal
````
roslaunch ardupilot_ros gzbo.launch #for quadrotor
````
or
````
roslaunch ardupilot_ros gzbo_rover.launch #for rover
````
This simulation has an iris copter equipped with a 360 degrees 2d lidar in a maze world, to launch it run:

### On 2nd Terminal
````
../Tools/autotest/sim_vehicle.py -f gazebo-iris
````
or
````
sim_vehicle.py -v APMrover2 -f gazebo-rover -m --mav10 -I1
````
```bash
ros2 launch ardupilot_gz_bringup iris_maze.launch.py
```
With the world and copter in place, launch cartographer to generate SLAM:

### On 3rd Terminal
````
roslaunch ardupilot_ros main.launch
````
```bash
ros2 launch ardupilot_ros cartographer.launch.py
```
Empty file added ardupilot_ros/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ options = {
map_builder = MAP_BUILDER,
trajectory_builder = TRAJECTORY_BUILDER,
map_frame = "map",
tracking_frame = "base_link",
tracking_frame = "imu_link",
published_frame = "base_link",
odom_frame = "odom",
provide_odom_frame = true,
Expand Down Expand Up @@ -52,4 +52,4 @@ POSE_GRAPH.constraint_builder.global_localization_min_score = 0.65
POSE_GRAPH.optimization_problem.huber_scale = 1e2
POSE_GRAPH.optimize_every_n_nodes = 30

return options
return options
Loading