Skip to content

MPC implementation using acados integrated with with PX4 on ROS2

License

Notifications You must be signed in to change notification settings

Jaeyoung-Lim/px4-mpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

px4-mpc

This package contains an MPC integrated with with PX4 Autopilot and ROS 2.

The MPC uses the acados framework

mpc_setpoint

Setup

The MPC formulation uses acados. In order to install acados, follow the following instructions To build the code, clone the following repositories into a ros2 workspace Dependencies

colcon build --packages-up-to px4_mpc

Testing demos

ros2 run px4_mpc quadrotor_demo

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

Run PX4 SITL

make px4_sitl gazebo

Run the micro-ros-agent

micro-ros-agent udp4 --port 8888

In order to launch the mpc quadrotor in a ros2 launchfile,

ros2 launch px4_mpc mpc_quadrotor_launch.py 

The mpc_spacecraft_launch.py file includes optional arguments:

  • mode: Control mode (wrench by default). Options: wrench, rate, direct_allocation.
  • namespace: Spacecraft namespace ('' by default).
  • setpoint_from_rviz: Use RViz for setpoints (True by default).

Example:

ros2 launch px4_mpc mpc_spacecraft_launch.py mode:=wrench namespace:=<namespace> setpoint_from_rviz:=False

About

MPC implementation using acados integrated with with PX4 on ROS2

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •