Repository Summary
| Description | MPC implementations integrated with with PX4 on ROS2 |
| Checkout URI | https://github.com/discower/px4-mpc.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-01-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
README
PX4 MPC - Interfacing PX4 with Model Predictive Control
This package contains an MPC integrated with with PX4 Autopilot and ROS 2.
The MPC uses the acados framework
Citing PX4-MPC
If you find this package useful in an academic context, please consider citing the paper
- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. “Towards Open-Source and Modular Space Systems with ATMOS.” arXiv preprint arXiv:2501.16973 (2025). . [preprint]
@article{roque2025towards,
title={Towards Open-Source and Modular Space Systems with ATMOS},
author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},
journal={arXiv preprint arXiv:2501.16973},
year={2025}
}
Setup
The MPC formulation uses acados. In order to install acados, follow the following instructions. After building acados remember to install the python interface as described here.
To build the code, do the following steps:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git # PX4 messages for communication with PX4 DDS
git clone https://github.com/Jaeyoung-Lim/px4-offboard.git # Rviz interface and setpoint generation
git clone https://github.com/DISCOWER/px4-mpc.git # this package
cd ..
colcon build --packages-up-to px4_mpc
source install/setup.bash # use source install/setup.zsh for zsh users
Running MPC with PX4 SITL
In order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup. For instructions, follow the documentation
Before proceding, start the DDS interface of PX4 by running
micro-xrce-dds-agent udp4 --port 8888
Quadrotor Example
On a new terminal, navigate to your PX4-Autopilot directory and run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl gz_x500
On another terminal, start PX4-MPC
ros2 launch px4_mpc mpc_quadrotor_launch.py
Now, check the QGC or Headless setup in section QGC Setup or Headless (no-QGC) Setup at the bottom of this guide.
Then, in the same terminal where you started the PX4 SITL, you can control the quadrotor using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
Spacecraft Example
First, make sure that you have followed the instructions in the ATMOS guide. ATMOS MPC node also requires vehicle angular velocity data. Please modify the file PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics-yaml and uncomment lines 56-57 to enable:
- topic: /fmu/out/vehicle_angular_velocity
type: px4_msgs::msg::VehicleAngularVelocity
Then, on your PX4-Autopilot directory, run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_spacecraft gz_atmos
On another terminal, run
ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False
Then, in the same terminal where you started the PX4 SITL, you can control ATMOS using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | MPC implementations integrated with with PX4 on ROS2 |
| Checkout URI | https://github.com/discower/px4-mpc.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-01-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
README
PX4 MPC - Interfacing PX4 with Model Predictive Control
This package contains an MPC integrated with with PX4 Autopilot and ROS 2.
The MPC uses the acados framework
Citing PX4-MPC
If you find this package useful in an academic context, please consider citing the paper
- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. “Towards Open-Source and Modular Space Systems with ATMOS.” arXiv preprint arXiv:2501.16973 (2025). . [preprint]
@article{roque2025towards,
title={Towards Open-Source and Modular Space Systems with ATMOS},
author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},
journal={arXiv preprint arXiv:2501.16973},
year={2025}
}
Setup
The MPC formulation uses acados. In order to install acados, follow the following instructions. After building acados remember to install the python interface as described here.
To build the code, do the following steps:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git # PX4 messages for communication with PX4 DDS
git clone https://github.com/Jaeyoung-Lim/px4-offboard.git # Rviz interface and setpoint generation
git clone https://github.com/DISCOWER/px4-mpc.git # this package
cd ..
colcon build --packages-up-to px4_mpc
source install/setup.bash # use source install/setup.zsh for zsh users
Running MPC with PX4 SITL
In order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup. For instructions, follow the documentation
Before proceding, start the DDS interface of PX4 by running
micro-xrce-dds-agent udp4 --port 8888
Quadrotor Example
On a new terminal, navigate to your PX4-Autopilot directory and run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl gz_x500
On another terminal, start PX4-MPC
ros2 launch px4_mpc mpc_quadrotor_launch.py
Now, check the QGC or Headless setup in section QGC Setup or Headless (no-QGC) Setup at the bottom of this guide.
Then, in the same terminal where you started the PX4 SITL, you can control the quadrotor using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
Spacecraft Example
First, make sure that you have followed the instructions in the ATMOS guide. ATMOS MPC node also requires vehicle angular velocity data. Please modify the file PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics-yaml and uncomment lines 56-57 to enable:
- topic: /fmu/out/vehicle_angular_velocity
type: px4_msgs::msg::VehicleAngularVelocity
Then, on your PX4-Autopilot directory, run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_spacecraft gz_atmos
On another terminal, run
ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False
Then, in the same terminal where you started the PX4 SITL, you can control ATMOS using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | MPC implementations integrated with with PX4 on ROS2 |
| Checkout URI | https://github.com/discower/px4-mpc.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-01-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
README
PX4 MPC - Interfacing PX4 with Model Predictive Control
This package contains an MPC integrated with with PX4 Autopilot and ROS 2.
The MPC uses the acados framework
Citing PX4-MPC
If you find this package useful in an academic context, please consider citing the paper
- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. “Towards Open-Source and Modular Space Systems with ATMOS.” arXiv preprint arXiv:2501.16973 (2025). . [preprint]
@article{roque2025towards,
title={Towards Open-Source and Modular Space Systems with ATMOS},
author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},
journal={arXiv preprint arXiv:2501.16973},
year={2025}
}
Setup
The MPC formulation uses acados. In order to install acados, follow the following instructions. After building acados remember to install the python interface as described here.
To build the code, do the following steps:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git # PX4 messages for communication with PX4 DDS
git clone https://github.com/Jaeyoung-Lim/px4-offboard.git # Rviz interface and setpoint generation
git clone https://github.com/DISCOWER/px4-mpc.git # this package
cd ..
colcon build --packages-up-to px4_mpc
source install/setup.bash # use source install/setup.zsh for zsh users
Running MPC with PX4 SITL
In order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup. For instructions, follow the documentation
Before proceding, start the DDS interface of PX4 by running
micro-xrce-dds-agent udp4 --port 8888
Quadrotor Example
On a new terminal, navigate to your PX4-Autopilot directory and run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl gz_x500
On another terminal, start PX4-MPC
ros2 launch px4_mpc mpc_quadrotor_launch.py
Now, check the QGC or Headless setup in section QGC Setup or Headless (no-QGC) Setup at the bottom of this guide.
Then, in the same terminal where you started the PX4 SITL, you can control the quadrotor using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
Spacecraft Example
First, make sure that you have followed the instructions in the ATMOS guide. ATMOS MPC node also requires vehicle angular velocity data. Please modify the file PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics-yaml and uncomment lines 56-57 to enable:
- topic: /fmu/out/vehicle_angular_velocity
type: px4_msgs::msg::VehicleAngularVelocity
Then, on your PX4-Autopilot directory, run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_spacecraft gz_atmos
On another terminal, run
ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False
Then, in the same terminal where you started the PX4 SITL, you can control ATMOS using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | MPC implementations integrated with with PX4 on ROS2 |
| Checkout URI | https://github.com/discower/px4-mpc.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-01-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
README
PX4 MPC - Interfacing PX4 with Model Predictive Control
This package contains an MPC integrated with with PX4 Autopilot and ROS 2.
The MPC uses the acados framework
Citing PX4-MPC
If you find this package useful in an academic context, please consider citing the paper
- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. “Towards Open-Source and Modular Space Systems with ATMOS.” arXiv preprint arXiv:2501.16973 (2025). . [preprint]
@article{roque2025towards,
title={Towards Open-Source and Modular Space Systems with ATMOS},
author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},
journal={arXiv preprint arXiv:2501.16973},
year={2025}
}
Setup
The MPC formulation uses acados. In order to install acados, follow the following instructions. After building acados remember to install the python interface as described here.
To build the code, do the following steps:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git # PX4 messages for communication with PX4 DDS
git clone https://github.com/Jaeyoung-Lim/px4-offboard.git # Rviz interface and setpoint generation
git clone https://github.com/DISCOWER/px4-mpc.git # this package
cd ..
colcon build --packages-up-to px4_mpc
source install/setup.bash # use source install/setup.zsh for zsh users
Running MPC with PX4 SITL
In order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup. For instructions, follow the documentation
Before proceding, start the DDS interface of PX4 by running
micro-xrce-dds-agent udp4 --port 8888
Quadrotor Example
On a new terminal, navigate to your PX4-Autopilot directory and run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl gz_x500
On another terminal, start PX4-MPC
ros2 launch px4_mpc mpc_quadrotor_launch.py
Now, check the QGC or Headless setup in section QGC Setup or Headless (no-QGC) Setup at the bottom of this guide.
Then, in the same terminal where you started the PX4 SITL, you can control the quadrotor using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
Spacecraft Example
First, make sure that you have followed the instructions in the ATMOS guide. ATMOS MPC node also requires vehicle angular velocity data. Please modify the file PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics-yaml and uncomment lines 56-57 to enable:
- topic: /fmu/out/vehicle_angular_velocity
type: px4_msgs::msg::VehicleAngularVelocity
Then, on your PX4-Autopilot directory, run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_spacecraft gz_atmos
On another terminal, run
ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False
Then, in the same terminal where you started the PX4 SITL, you can control ATMOS using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | MPC implementations integrated with with PX4 on ROS2 |
| Checkout URI | https://github.com/discower/px4-mpc.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-01-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
README
PX4 MPC - Interfacing PX4 with Model Predictive Control
This package contains an MPC integrated with with PX4 Autopilot and ROS 2.
The MPC uses the acados framework
Citing PX4-MPC
If you find this package useful in an academic context, please consider citing the paper
- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. “Towards Open-Source and Modular Space Systems with ATMOS.” arXiv preprint arXiv:2501.16973 (2025). . [preprint]
@article{roque2025towards,
title={Towards Open-Source and Modular Space Systems with ATMOS},
author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},
journal={arXiv preprint arXiv:2501.16973},
year={2025}
}
Setup
The MPC formulation uses acados. In order to install acados, follow the following instructions. After building acados remember to install the python interface as described here.
To build the code, do the following steps:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git # PX4 messages for communication with PX4 DDS
git clone https://github.com/Jaeyoung-Lim/px4-offboard.git # Rviz interface and setpoint generation
git clone https://github.com/DISCOWER/px4-mpc.git # this package
cd ..
colcon build --packages-up-to px4_mpc
source install/setup.bash # use source install/setup.zsh for zsh users
Running MPC with PX4 SITL
In order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup. For instructions, follow the documentation
Before proceding, start the DDS interface of PX4 by running
micro-xrce-dds-agent udp4 --port 8888
Quadrotor Example
On a new terminal, navigate to your PX4-Autopilot directory and run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl gz_x500
On another terminal, start PX4-MPC
ros2 launch px4_mpc mpc_quadrotor_launch.py
Now, check the QGC or Headless setup in section QGC Setup or Headless (no-QGC) Setup at the bottom of this guide.
Then, in the same terminal where you started the PX4 SITL, you can control the quadrotor using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
Spacecraft Example
First, make sure that you have followed the instructions in the ATMOS guide. ATMOS MPC node also requires vehicle angular velocity data. Please modify the file PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics-yaml and uncomment lines 56-57 to enable:
- topic: /fmu/out/vehicle_angular_velocity
type: px4_msgs::msg::VehicleAngularVelocity
Then, on your PX4-Autopilot directory, run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_spacecraft gz_atmos
On another terminal, run
ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False
Then, in the same terminal where you started the PX4 SITL, you can control ATMOS using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | MPC implementations integrated with with PX4 on ROS2 |
| Checkout URI | https://github.com/discower/px4-mpc.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-01-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
README
PX4 MPC - Interfacing PX4 with Model Predictive Control
This package contains an MPC integrated with with PX4 Autopilot and ROS 2.
The MPC uses the acados framework
Citing PX4-MPC
If you find this package useful in an academic context, please consider citing the paper
- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. “Towards Open-Source and Modular Space Systems with ATMOS.” arXiv preprint arXiv:2501.16973 (2025). . [preprint]
@article{roque2025towards,
title={Towards Open-Source and Modular Space Systems with ATMOS},
author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},
journal={arXiv preprint arXiv:2501.16973},
year={2025}
}
Setup
The MPC formulation uses acados. In order to install acados, follow the following instructions. After building acados remember to install the python interface as described here.
To build the code, do the following steps:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git # PX4 messages for communication with PX4 DDS
git clone https://github.com/Jaeyoung-Lim/px4-offboard.git # Rviz interface and setpoint generation
git clone https://github.com/DISCOWER/px4-mpc.git # this package
cd ..
colcon build --packages-up-to px4_mpc
source install/setup.bash # use source install/setup.zsh for zsh users
Running MPC with PX4 SITL
In order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup. For instructions, follow the documentation
Before proceding, start the DDS interface of PX4 by running
micro-xrce-dds-agent udp4 --port 8888
Quadrotor Example
On a new terminal, navigate to your PX4-Autopilot directory and run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl gz_x500
On another terminal, start PX4-MPC
ros2 launch px4_mpc mpc_quadrotor_launch.py
Now, check the QGC or Headless setup in section QGC Setup or Headless (no-QGC) Setup at the bottom of this guide.
Then, in the same terminal where you started the PX4 SITL, you can control the quadrotor using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
Spacecraft Example
First, make sure that you have followed the instructions in the ATMOS guide. ATMOS MPC node also requires vehicle angular velocity data. Please modify the file PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics-yaml and uncomment lines 56-57 to enable:
- topic: /fmu/out/vehicle_angular_velocity
type: px4_msgs::msg::VehicleAngularVelocity
Then, on your PX4-Autopilot directory, run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_spacecraft gz_atmos
On another terminal, run
ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False
Then, in the same terminal where you started the PX4 SITL, you can control ATMOS using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | MPC implementations integrated with with PX4 on ROS2 |
| Checkout URI | https://github.com/discower/px4-mpc.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-01-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
README
PX4 MPC - Interfacing PX4 with Model Predictive Control
This package contains an MPC integrated with with PX4 Autopilot and ROS 2.
The MPC uses the acados framework
Citing PX4-MPC
If you find this package useful in an academic context, please consider citing the paper
- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. “Towards Open-Source and Modular Space Systems with ATMOS.” arXiv preprint arXiv:2501.16973 (2025). . [preprint]
@article{roque2025towards,
title={Towards Open-Source and Modular Space Systems with ATMOS},
author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},
journal={arXiv preprint arXiv:2501.16973},
year={2025}
}
Setup
The MPC formulation uses acados. In order to install acados, follow the following instructions. After building acados remember to install the python interface as described here.
To build the code, do the following steps:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git # PX4 messages for communication with PX4 DDS
git clone https://github.com/Jaeyoung-Lim/px4-offboard.git # Rviz interface and setpoint generation
git clone https://github.com/DISCOWER/px4-mpc.git # this package
cd ..
colcon build --packages-up-to px4_mpc
source install/setup.bash # use source install/setup.zsh for zsh users
Running MPC with PX4 SITL
In order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup. For instructions, follow the documentation
Before proceding, start the DDS interface of PX4 by running
micro-xrce-dds-agent udp4 --port 8888
Quadrotor Example
On a new terminal, navigate to your PX4-Autopilot directory and run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl gz_x500
On another terminal, start PX4-MPC
ros2 launch px4_mpc mpc_quadrotor_launch.py
Now, check the QGC or Headless setup in section QGC Setup or Headless (no-QGC) Setup at the bottom of this guide.
Then, in the same terminal where you started the PX4 SITL, you can control the quadrotor using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
Spacecraft Example
First, make sure that you have followed the instructions in the ATMOS guide. ATMOS MPC node also requires vehicle angular velocity data. Please modify the file PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics-yaml and uncomment lines 56-57 to enable:
- topic: /fmu/out/vehicle_angular_velocity
type: px4_msgs::msg::VehicleAngularVelocity
Then, on your PX4-Autopilot directory, run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_spacecraft gz_atmos
On another terminal, run
ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False
Then, in the same terminal where you started the PX4 SITL, you can control ATMOS using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | MPC implementations integrated with with PX4 on ROS2 |
| Checkout URI | https://github.com/discower/px4-mpc.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-01-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
README
PX4 MPC - Interfacing PX4 with Model Predictive Control
This package contains an MPC integrated with with PX4 Autopilot and ROS 2.
The MPC uses the acados framework
Citing PX4-MPC
If you find this package useful in an academic context, please consider citing the paper
- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. “Towards Open-Source and Modular Space Systems with ATMOS.” arXiv preprint arXiv:2501.16973 (2025). . [preprint]
@article{roque2025towards,
title={Towards Open-Source and Modular Space Systems with ATMOS},
author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},
journal={arXiv preprint arXiv:2501.16973},
year={2025}
}
Setup
The MPC formulation uses acados. In order to install acados, follow the following instructions. After building acados remember to install the python interface as described here.
To build the code, do the following steps:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git # PX4 messages for communication with PX4 DDS
git clone https://github.com/Jaeyoung-Lim/px4-offboard.git # Rviz interface and setpoint generation
git clone https://github.com/DISCOWER/px4-mpc.git # this package
cd ..
colcon build --packages-up-to px4_mpc
source install/setup.bash # use source install/setup.zsh for zsh users
Running MPC with PX4 SITL
In order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup. For instructions, follow the documentation
Before proceding, start the DDS interface of PX4 by running
micro-xrce-dds-agent udp4 --port 8888
Quadrotor Example
On a new terminal, navigate to your PX4-Autopilot directory and run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl gz_x500
On another terminal, start PX4-MPC
ros2 launch px4_mpc mpc_quadrotor_launch.py
Now, check the QGC or Headless setup in section QGC Setup or Headless (no-QGC) Setup at the bottom of this guide.
Then, in the same terminal where you started the PX4 SITL, you can control the quadrotor using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
Spacecraft Example
First, make sure that you have followed the instructions in the ATMOS guide. ATMOS MPC node also requires vehicle angular velocity data. Please modify the file PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics-yaml and uncomment lines 56-57 to enable:
- topic: /fmu/out/vehicle_angular_velocity
type: px4_msgs::msg::VehicleAngularVelocity
Then, on your PX4-Autopilot directory, run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_spacecraft gz_atmos
On another terminal, run
ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False
Then, in the same terminal where you started the PX4 SITL, you can control ATMOS using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
| Description | MPC implementations integrated with with PX4 on ROS2 |
| Checkout URI | https://github.com/discower/px4-mpc.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2026-01-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
README
PX4 MPC - Interfacing PX4 with Model Predictive Control
This package contains an MPC integrated with with PX4 Autopilot and ROS 2.
The MPC uses the acados framework
Citing PX4-MPC
If you find this package useful in an academic context, please consider citing the paper
- Roque, Pedro, Sujet Phodapol, Elias Krantz, Jaeyoung Lim, Joris Verhagen, Frank Jiang, David Dorner, Roland Siegwart, Ivan Stenius, Gunnar Tibert, Huina Mao, Jana Tumova, Christer Fuglesang, Dimos V. Dimarogonas. “Towards Open-Source and Modular Space Systems with ATMOS.” arXiv preprint arXiv:2501.16973 (2025). . [preprint]
@article{roque2025towards,
title={Towards Open-Source and Modular Space Systems with ATMOS},
author={Roque, Pedro and Phodapol, Sujet and Krantz, Elias and Lim, Jaeyoung and Verhagen, Joris and Jiang, Frank and Dorner, David and Siegwart, Roland and Stenius, Ivan and Tibert, Gunnar and others},
journal={arXiv preprint arXiv:2501.16973},
year={2025}
}
Setup
The MPC formulation uses acados. In order to install acados, follow the following instructions. After building acados remember to install the python interface as described here.
To build the code, do the following steps:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git # PX4 messages for communication with PX4 DDS
git clone https://github.com/Jaeyoung-Lim/px4-offboard.git # Rviz interface and setpoint generation
git clone https://github.com/DISCOWER/px4-mpc.git # this package
cd ..
colcon build --packages-up-to px4_mpc
source install/setup.bash # use source install/setup.zsh for zsh users
Running MPC with PX4 SITL
In order to run the SITL(Software-In-The-Loop) simulation, the PX4 simulation environment and ROS2 needs to be setup. For instructions, follow the documentation
Before proceding, start the DDS interface of PX4 by running
micro-xrce-dds-agent udp4 --port 8888
Quadrotor Example
On a new terminal, navigate to your PX4-Autopilot directory and run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl gz_x500
On another terminal, start PX4-MPC
ros2 launch px4_mpc mpc_quadrotor_launch.py
Now, check the QGC or Headless setup in section QGC Setup or Headless (no-QGC) Setup at the bottom of this guide.
Then, in the same terminal where you started the PX4 SITL, you can control the quadrotor using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
Spacecraft Example
First, make sure that you have followed the instructions in the ATMOS guide. ATMOS MPC node also requires vehicle angular velocity data. Please modify the file PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics-yaml and uncomment lines 56-57 to enable:
- topic: /fmu/out/vehicle_angular_velocity
type: px4_msgs::msg::VehicleAngularVelocity
Then, on your PX4-Autopilot directory, run the following command to start the PX4 SITL with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_spacecraft gz_atmos
On another terminal, run
ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench setpoint_from_rviz:=False
Then, in the same terminal where you started the PX4 SITL, you can control ATMOS using the following commands:
- To arm the vehicle:
commander arm
- To follow the MPC setpoints:
commander mode offboard
File truncated at 100 lines see the full file