Skip to content

Commit

Permalink
ardupilot_ros: add nav2 example on README
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-fuoco committed Sep 2, 2023
1 parent b618086 commit 5c7c58d
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,38 @@ If you'd like to get the information from Cartographer to go into Ardupilot's ex
The parameters above are recommended for SITL. If you plan on using this on a real copter, it is a good idea to setup a second source of EKF. This way the robot doesn't crash if the external odometry you are providing stops publishing or gets lost.

Please refer to this link for more information on [Common EKF Sources](https://ardupilot.org/copter/docs/common-ekf-sources.html>) as well as this guide on [GPS / Non-GPS Transitions](https://ardupilot.org/copter/docs/common-non-gps-to-gps.html).

### 2. Obstacle avoidance using Cartographer and Nav2

Using the same simulation as before, the nav2 node can be launched to control the copter once it is in the air.

Launch the simulation:

```bash
ros2 launch ardupilot_gz_bringup iris_maze.launch.py rviz:=false
```
Launch cartographer:

```bash
ros2 launch ardupilot_ros cartographer.launch.py rviz:=false
```

Launch nav2:

```bash
ros2 launch ardupilot_ros navigation.launch.py
```

Takeoff the Copter using `mavproxy` to an altitude of 2.5m:

```bash
mavproxy.py --console --map --aircraft test --master=:14550

mode guided

arm throttle

takeoff 2.5
```

You may now navigate while mapping using the `Nav2 Goal` tool in RVIZ!

0 comments on commit 5c7c58d

Please sign in to comment.