Read this document: The Challenge Question.
This project is built using PX4 and uXRCE-DDS bridge to ROS2 Humble. I chose this method over directly implementing using MAVSDK-Python because I believe ROS2 provides additional considerations for safety-critical applications such as autonomous robots (such as UAVs) where the points of software failure can be compartmentalized without making breaking changes downstream on my local machine or upstream with changes to the PX4 stack itself. This project package should work indefinitely if all the build instructions are followed for the duration of the respective module's support timelines.
This repository has multiple supporting docs to demonstrate the results of this project when it was executed on the author's computer. The following is a brief summary:
-
Video 1: screen capture of the Gazebo simulator and the mission visualizer
-
Video 2: screen capture of the mission progression using the QGroundControl GCS
-
The mission waypoint file (with header description) - change waypoints as needed and recompile the project
-
Flight logs:
- The log
ulg
file - The log
bag
file - useplotjuggler
to visualize this. - Link to the PX4 logs hosted online
- Copy of the flight review
- Copy of the PID analysis
- The log
First, follow the instructions from the ROS2 User Guide in the official PX4 development website. Once you've built the ROS2 workspace, the rest of the installation and setup guide is entirely optional. Navigate to the src
directory of your ROS2 workspace (eg: ros2_ws
) and clone this repository using:
user@computer:<path/to/ros2_ws/src>$ git clone [email protected]:varundevsukhil/reimagined-octo-fiesta.git
Navigate back to the root of your ROS2 workspace, and execute the following command:
user@computer:<path/to/ros2_ws/>$ colcon build --packages-select freefly_challenge
If you see an output similar to the following in your terminal, then the build process is complete:
Starting >>> freefly_challenge
Finished <<< freefly_challenge [0.59s]
Summary: 1 package finished [0.66s]
If the build process fails, contact the author with the error logs.
For testing this project, we are going to use four applications that will have to be run in their own terminals.
- The uXRCE DDS agent. This application allows for bi-directional communications between the PX4 flight stack and the ROS2 middleware libraries (including the project in this repository). Use the following command to start the DDS agent:
user@computer:~$ MicroXRCEAgent udp4 -p 8888
- The PX4 SITL (software-in-the-loop) application. This project uses the default x500 quadcopter model in a blank Gazebo world for simplicity. Navigate to the root directory of the PX4 stack on your local computer and use the following command to start the simulator:
user@computer:<path/to/px4-root-directory/>$ make px4_sitl gz_x500
-
The QGroundControl, or QGC, is the GCS software system commonly used with the PX4 flight control stack. It is generally a single executable
.AppImage
that can be launched as a normal application. This software can be downloaded from the official source. -
Finally, the technical challenge project (which includes a visualizer, a GUI interface, and the mission node) can be launched using a single ROS2 launch file provided in this repository using the following command:
user@computer:~$ ros2 launch freefly_challenge mission.launch.py
The mission software for this technical challenge has a 10 second delayed start to allow you to adjust the positions of the application windows (if you find this necessary). Sit back, and enjoy the show! The default mission is to trace the letters FS
as a tribute to Freefly Systems. The following is a plot that shows (top) the arming state of the aircraft, (middle) the navigation state of the aircraft, and (bottom) the {x, y, z}
position tuple in the local coordinate frame where the aircraft's origin for the current mission is set to the location it is armed at.
Varundev Sukhil is a computer engineer and a roboticist.