GSoC 2023: GPS-Denied Autonomous Exploration with ROS 2

image

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:

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:

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
  • 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.

10 Likes

@pedro-fuoco so great to have you working on this in GSoC!

1 Like

Weekly updates May 23rd

A ~15min weekly meeting will be held at the Ardupilot Discord at every Tuesday 23h00 GMT, feel free to join

This has been settled, a “humble” branch will be created at GitHub - ArduPilot/ardupilot_ros: ArduPilot ROS integration
A PR has been submitted to transform it into an empty ros2 package, so I can begin my work.

Here are some considerations:
Foxglove Studio vs. RViz
TL;DR

  • Rviz requires ROS or ROS 2 installed. Foxglove supports bag playback and has a browser client option for those not willing to download it.
    • This makes it more accessible, but I think it is fair to assume that people interested in this project will have ROS installed

In addition to that it is relevant to mention that the nav2 stack and ardupilot_gz both come with multiple examples that use rviz2.

With that in mind I think it would be better to work with rviz2, as most tools that will be used in this project are already using it.
@rfriedman mentioned adding Foxglove support if I decided to go with rviz2, I could also add it if I have some spare time during the project development (it shouldn’t take long anyway), as it would be nice to be able to run the bags and show the progress in any computer.


Thanks to @rhys for showing me the way. I had some problems to make it work, so I will provide some feedback/contribute to the documentation, as well as start the README for this project’s repo guiding the user on where to find the installation instructions

@arshPratap’s amazing GSoC project will cover this dependencies. If the complete control interface isn’t done in time I can work towards a simpler version with velocity setpoints towards AP guided mode.

Notes:

  • ardupilot_ros now has a humble branch: GitHub - ArduPilot/ardupilot_ros at humble
  • ROS Control: Start with copter for now, and move GCS_Mavlink to call into AP_ExternalControl). Need path from DDS to guided mode functions without guided. Need to start with the library, then swap mavlink to use it, and finally add Lua support. Remove centidegrees. The library needs to pick rad/deg, lean towards SI, however user facing. If display or control interface. Example, the attitude message is in radians. Pick one, don’t mix.
  • Pedro leaning towards rviz2 due to other tools use it.

Actions:

  • Pedro to make a PR to move the SDF/world files from ardupilot_ros to ardupilot_gazebo
  • Pedro to see if iris_warehouse has same coordinate issues as ardupilot_gazebo#59 or use walled_iris_runway
  • Ryan to bootstrap initial ardupilot wiki ROS 2 page
  • Ryan to meet with Randy and Tridge and Arsh to hash out a control plane (AP_ExternalControl) and document it. Ryan to write the interface for the control library.
  • For PR’s, test against RVIZ.
1 Like

I talked to @rhys , let’s put the URDF models in ardupilot_gz since that already has the launch files. According to Rhys, “ardupilot_gazebo is the SITL /JSON plugin with a minimal number examples to get up and running”.

2 Likes

Yes, ardupilot_gazebo doesn’t have a dependency on ROS so it can be run by users with only ArduPilot and Gazebo installed. There are a couple of example models to get up and running, but most of the SDF models live in SITL_Models/Gazebo. This is because the models tend to be large (textures and meshes), and we want to keep the plugin repo light-weight.

ardupilot_gz assumes a ROS install, and will have access to xacro and other packages which allow you to generate SDF from xacro / urdf.

1 Like