Implement MPC mc_attitude_controller in ROS2

I aim to implement a Model Predictive Control (MPC) attitude controller (including angular rate control) for a multicopter. The controller will be deployed on a companion computer running ROS2, where it will compute torque and thrust commands and transmit them to the Pixhawk flight controller. The Pixhawk will then handle the mixer logic to generate motor signals.

Within the ROS2 framework, the controller’s inputs will include:

  • Current attitude and angular rates (measured states)
  • Desired attitude and angular rates (reference commands)

After computation by the MPC controller, the outputs (torque and thrust) will be sent to the Pixhawk.

In this architecture, the Pixhawk operates in its stabilized mode (i.e., without an outer position control loop), allowing me to evaluate the performance of the custom attitude controller in isolation.

Questions:

  1. Is this approach feasible for testing and validating a standalone attitude controller?
  2. Are there prior works or reference implementations that have adopted a similar methodology?