Code for Submission: "Lightweight Tracking Control for Computationally Constrained Aerial Systems with Newton-Raphson Flow"
Video footage for certain flights may be seen here
Paper: "Lightweight Tracking Control for Computationally Constrained Aerial Systems with the Newton-Raphson Method", preprint available
Authors: Evanns Morales-Cuadrado, Luke Baird, Yorai Wardi, Samuel Coogan
Venue: IEEE Transactions on Control Systems Technology (TCST), 2026
- Users of this code must use the
/src/folder here in a ROS2 workspace and build - Users may also use the
environment.ymlfile to set up a conda environment with the necessary packages to run the code below - Docker (in development): A Docker-based workspace is available at ws_px4_work. Note that this is still under active development, but it aims to simplify the full PX4/ROS2 environment setup
This repository uses git submodules for the quadrotor packages. Clone with:
git clone --recurse-submodules git@github.com:evannsmc/MoralesCuadrado_Baird_TCST2025.gitIf you already cloned without --recurse-submodules, initialize the submodules with:
git submodule update --init --recursiveIf you are using a motion capture system for hardware flights, you may need the following packages cloned into your ROS2 workspace src/ directory:
# Vicon
git clone git@github.com:evannsmc/vicon4px4.git
# OptiTrack
git clone git@github.com:evannsmc/optitrack4px4.git
# PX4 messages (minimal branch)
git clone -b v1.16_minimal_msgs git@github.com:evannsmc/px4_msgs.git
# Mocap messages and relay nodes
git clone git@github.com:evannsmc/mocap_msgs.git
git clone git@github.com:evannsmc/mocap_px4_relays.gitThen build from the workspace root:
cd .. # back to workspace root
colcon build --symlink-installThe quadrotor packages (quad_newton_raphson_flow and quad_mpc) are included as git submodules pointing to their standalone repositories:
- NR Flow: newton_raphson_px4
- NMPC: nmpc_acados_px4
- Follow the instructions (here) to set up the PX4 Autopilot Stack, ROS2, Micro XRCE-DDS Agent & Client, and build a ROS2 workspace with the necessary px4 communication repos
- In the same workspace with the communication folders as above, go to the
/src/folder and clone this repository (with submodules as described above) - Install the conda environment:
conda env create -f environment.yml- For the NMPC controller, you must also install Acados — see the NMPC package README for detailed Acados setup instructions
- In the root of the workspace, build everything:
colcon build --symlink-install- Run the SITL simulation:
make px4_sitl gazebo-classic- Run the Micro XRCE Agent as the bridge between ROS2 and PX4:
MicroXRCEAgent udp4 -p 8888- In another terminal, source the workspace and activate your conda environment:
source install/setup.bash
conda activate <your_env_name>- Run the controller:
# Simulation — circle trajectory
ros2 run newton_raphson_px4 run_node --platform sim --trajectory circle_horz
# Hardware — helix trajectory with logging
ros2 run newton_raphson_px4 run_node --platform hw --trajectory helix --log
# Hover mode 3, double speed, with yaw spin
ros2 run newton_raphson_px4 run_node --platform sim --trajectory hover --hover-mode 3 --double-speed --spin| Flag | Description |
|---|---|
--platform {sim,hw} |
Target platform (required) |
--trajectory {hover,yaw_only,circle_horz,...} |
Trajectory type (required) |
--hover-mode {1..8} |
Hover sub-mode (1-4 for hardware) |
--log |
Enable CSV data logging |
--log-file NAME |
Custom log filename |
--double-speed |
2x trajectory speed |
--short |
Short variant (fig8_vert) |
--spin |
Enable yaw rotation |
--flight-period SEC |
Custom flight duration |
--ff |
Feedforward marker (only valid with fig8_contraction) |
- In another terminal, source the workspace and activate your conda environment:
source install/setup.bash
conda activate <your_env_name>- Run the controller:
# Simulation — figure-8 trajectory
ros2 run nmpc_acados_px4 run_node --platform sim --trajectory fig8_horz
# Hardware — helix trajectory with logging
ros2 run nmpc_acados_px4 run_node --platform hw --trajectory helix --logThe NMPC CLI options are the same as the NR Flow options listed above.
The blimp package (blimp_mpc_fbl_nr) includes MPC, FBL (feedback linearization via CBF), and NR Flow controllers for both simulation and hardware.
- In a terminal, source the workspace and activate your conda environment:
source install/setup.bash
conda activate <your_env_name>- Run a simulation using the
run_blimp_simentry point with a controller/trajectory key and a log filename:
ros2 run blimp_mpc_fbl_nr run_blimp_sim <controller_key> <logfile>NR Flow (nr):
hardware_nr_circle_horz, hardware_nr_circle_vert, hardware_nr_fig8_horz, hardware_nr_fig8_vert_short, hardware_nr_fig8_vert_tall, hardware_nr_circle_horz_spin, hardware_nr_helix, hardware_nr_helix_spin
MPC (mpc):
hardware_mpc_circle_horz, hardware_mpc_circle_vert, hardware_mpc_fig8_horz, hardware_mpc_fig8_vert_short, hardware_mpc_fig8_vert_tall, hardware_mpc_circle_horz_spin, hardware_mpc_helix, hardware_mpc_helix_spin
FBL (fbl):
hardware_fbl_circle_horz, hardware_fbl_circle_vert, hardware_fbl_fig8_horz, hardware_fbl_fig8_vert_short, hardware_fbl_fig8_vert_tall, hardware_fbl_circle_horz_spin, hardware_fbl_helix, hardware_fbl_helix_spin
# Run NR Flow on a horizontal circle trajectory
ros2 run blimp_mpc_fbl_nr run_blimp_sim hardware_nr_circle_horz log1.log
# Run MPC on a helix trajectory
ros2 run blimp_mpc_fbl_nr run_blimp_sim hardware_mpc_helix log1.log
# Run FBL on a figure-8 trajectory
ros2 run blimp_mpc_fbl_nr run_blimp_sim hardware_fbl_fig8_horz log1.logEach controller/trajectory combination also has a dedicated entry point:
NR Flow:
ros2 run blimp_mpc_fbl_nr run_wardi_circle_horz
ros2 run blimp_mpc_fbl_nr run_wardi_circle_vert
ros2 run blimp_mpc_fbl_nr run_wardi_fig8_horz
ros2 run blimp_mpc_fbl_nr run_wardi_fig8_vert_short
ros2 run blimp_mpc_fbl_nr run_wardi_fig8_vert_tall
ros2 run blimp_mpc_fbl_nr run_wardi_circle_horz_spin
ros2 run blimp_mpc_fbl_nr run_wardi_helix
ros2 run blimp_mpc_fbl_nr run_wardi_helix_spinNLMPC:
ros2 run blimp_mpc_fbl_nr run_nlmpc_circle_horz
ros2 run blimp_mpc_fbl_nr run_nlmpc_circle_vert
ros2 run blimp_mpc_fbl_nr run_nlmpc_fig8_horz
ros2 run blimp_mpc_fbl_nr run_nlmpc_fig8_vert_short
ros2 run blimp_mpc_fbl_nr run_nlmpc_fig8_vert_tall
ros2 run blimp_mpc_fbl_nr run_nlmpc_circle_horz_spin
ros2 run blimp_mpc_fbl_nr run_nlmpc_helix
ros2 run blimp_mpc_fbl_nr run_nlmpc_helix_spinCBF (FBL):
ros2 run blimp_mpc_fbl_nr run_cbf_circle_horz
ros2 run blimp_mpc_fbl_nr run_cbf_circle_vert
ros2 run blimp_mpc_fbl_nr run_cbf_fig8_horz
ros2 run blimp_mpc_fbl_nr run_cbf_fig8_vert_short
ros2 run blimp_mpc_fbl_nr run_cbf_fig8_vert_tall
ros2 run blimp_mpc_fbl_nr run_cbf_circle_horz_spin
ros2 run blimp_mpc_fbl_nr run_cbf_helix
ros2 run blimp_mpc_fbl_nr run_cbf_helix_spinPlease see the arxiv preprint here
Evanns G. Morales-Cuadrado, Luke Baird, Yorai Wardi, Samuel Coogan