Introduction
Hi! I’m Pedro Pimentel Fuoco, a 4th year undergraduate student from the Polytechnic School of the University of São Paulo studying mechatronic engineering. I’ve been at the USP autonomous drone team since I started university and last year I was appointed head of software development for 2022. I worked a lot transitioning between ROS and ROS2 during our competitions so contributing to the ROS 2/DDS support in Ardupilot really caught my eye. In the last few months I’ve been helping out by adding data writers on the AP_DDS_Client, which publishes Ardupilot data to ROS 2 topics.
I am thrilled to announce that I’ve been selected for GSoC’23 to work towards my project “GPS-Denied Autonomous Exploration with ROS 2” with the help of the Ardupulot community and my mentors @tridge and @rfriedman.
The current state of the ROS 2/DDS support
Using and contributing to the ROS 2 support is still a challenge, as there are little to no use cases documented. Taking that into account, generating code and documentation about Ardupilot’s integration with ROS 2 serves the interests of the community and allows for more contributions to focus on DDS in the future.
Project Motivation
GSoC 2022 had a very interesting project about non-GPS navigation on copters and
rovers, but one of it’s main problems was pointed in the comments by @soldierofhell: “ROS 1
will be EOL in 2025”, to which @snktshrma, the student responsible for the project,
answered “Shifting to ROS2 and Navigation2 is on the future tasks for this project”. Furthermore, it will be a great addition to have a non-GPS SLAM working and documented
on ROS 2. Replicating similar results to their project should be simpler and faster this year
because of the documentation and scripts created, so it is possible to use the time left
implementing a new and innovative use case to Ardupilot.
Exploration of unknown indoor environments is a major issue in mobile robotics, as it
significantly limits the environments in which completely autonomous robots are able to
operate. Autonomous exploration has gained a lot of attention in the last few years, with lots of applications in search and rescue, pipeline maintenance and cave mapping.
The proposed idea is to keep contributing to DDS support, but focusing specifically
on replicating GSoC’22 non-GPS navigation setup and using it for autonomous exploration in ROS 2, which will help building a documentation foundation for future projects
interested in using DDS instead of MAVROS, as well as expanding the use cases for
Ardupilot with ROS.
As agreed with my mentors, the project will focus on multirotor vehicles, support for other vehicles may be added later.
Project Roadmap
I will update this roadmap with checks and images as the project progresses, so feel free to look into the detailed tasks to know where the project currently is at.
I’ve divided the project in four parts:
Part 0 - Setting up the development environment
Prerequisites:
- Ardupilot with DDS works in SITL with gazebo
- Discuss which repository will host this project
Tasks
- Set up ROS Humble
- Set up Ardupilot SITL through DDS
- Install the required ROS 2 packages
- Setup the simulation in gazebo
- Get a obstacle map working with an Iris spawned
- Add the lidar sensor to Iris and get the sensor data published to ROS 2
Part 1 - Mapping and localization
Prerequisites:
- Settle between using rviz2 or foxglove for visualization
- DDS supports external odometry sources input
- Get a page for ROS 2 on Ardupilot Wiki
Tasks
- Tune cartographer SLAM to generate odometry and a OccupancyGrid from the lidar data
- Configure Ardupilot to support ExternalNav
- Send ExternalNav odometry from cartographer_ros to Ardupilot’s Extended Kalman Filter through DDS
- Setup rviz2 or Foxglove to visualize both the OccupancyGrid and the odometry output
- Test the SLAM working on SITL
- Create scripts to easily reproduce the results of the tests and store them openly at the project repository
- Record a video of it working properly and how to set it up
- Document all the details of this process, producing a page for ROS 2 similar to this on the Ardupilot Wiki.
Important Observations
This is an opportunity to improve the process of getting a external-odometry-based application working with ArduPilot
Acceptance criteria for the documentation is someone with not a lot of experience with ROS 2 should be able to run it.
People with ROS1 + Mavlink/Mavros background should have an easy migration experience, as they will likely be the majority of the public using this project.
Part 2 - 2D Path planning and obstacle avoidance
Prerequisites:
- Arm through a ROS 2 service
- Mode switch through ROS 2 services
-
AP_DDS should have a control interface (at least a velocity setpoint subscriber)
- Dependency: AP_DDS has subscriber support
- Dependency: AP_DDS is able to send setpoints to work with AP’s guided mode
Tasks
- Install the required ROS 2 packages
- Nav2
- Porting ap_navigation to work with nav2 and DDS
- Integrate rviz2 or Foxglove to use “2D Nav Goal” button to set the a position target for the offboard path-planning
- Send a position (?) and velocity setpoint through the ROS 2 control interface to Copter
- Use rviz2 or Foxglove to see the CostMaps and Path Planned
- Test the navigation
- Create scripts to easily reproduce the results of the tests and store them openly at the project repository
- Record a video of it working properly and how to set it up
- Document all the details of this process, producing a page for ROS 2 similar to this on the Ardupilot Wiki.
Important Observations
As a stretch (if time allows it) it would be awesome to support external obstacle sensors data to be sent directly from ROS 2 to Ardupilot, so we could use AP_Proximity over DDS
Part 3 - Autonomous exploration
Prerequisites:
Settle which exploration algorithm will be used (this paper is my initial suggestion)
Tasks
- Implement Wavefront Frontier Detection algorithm to find a boundary between unexplored and explored space in the OccupancyGrid
- The paper mentioned presents pseudocode for it, and open source repositories using WFD with nav2 can be found on github
- Iteratively use the boundary points as position targets for the offboard path-planning
- Create scripts to easily reproduce the results of the tests and store them openly at the project repository
- Record a video of it working properly and how to set it up
- Document all the details of this process, producing a page for “autonomous exploration in GPS-denied environments” on the ROS 2 page at Ardupilot Wiki.
Important Observations
If time allows, it would be great to test the same setup of autonomous exploration with a rover, in order to produce more documentation with different vehicles.
Community participation
I’m excited to hear what members of the community and the dev team have to say about the project, feel free to comment suggestions and feedbacks on the comments section below!
In addition to that, as @rfriedman suggested and previous GSoC contributors highlighted during this year’s GSoC Summit, discussions about the work done in this project will be done in public channels, such as blog posts and discord chats, so that members of the community can contribute and help out with their opinions and experiences.