ROS2 PX4 quadrotor controller package using a dual-loop ADRC structure and direct motor actuation.
- PX4-native
NEDandFRDcontrol path - Position loop driven by
/fmu/out/vehicle_local_position - Attitude state from
/fmu/out/vehicle_attitude - Attitude loop driven by
/fmu/out/vehicle_angular_velocity - Fixed Quad-X motor order for PX4
direct_actuatormode - Per-motor thrust mapped to throttle using PX4
THR_MDL_FAC - Continuous offboard requests after node startup
- Manual arm required before automatic takeoff
- Package-local
FlatTrajectoryReferencemessage and trajectory publisher
The controller uses this fixed PX4 direct-actuator order:
- front-right, CCW
- back-left, CCW
- front-left, CW
- back-right, CW
No runtime motor_output_map parameter is kept.
- Start the node.
- The node continuously requests PX4 offboard mode.
- Manually arm the vehicle.
- The node performs automatic takeoff to the configured height.
- After takeoff hold, the node publishes
start_tracking=trueon/mission/start_tracking. - The trajectory publisher starts emitting
/px4adrc/reference. - The controller switches to tracking when a fresh reference arrives.
/fmu/out/vehicle_local_position/fmu/out/vehicle_attitude/fmu/out/vehicle_angular_velocity/fmu/out/vehicle_status_v1
The controller requires valid vehicle_local_position XY/Z and VXY/VZ estimates before running control.
position_ned,velocity_ned,acceleration_ned,jerk_ned,snap_ned: PX4 world frameNEDyaw,yaw_rate,yaw_acceleration: desired heading and heading derivatives inNED
Controller tuning lives in config/px4adrc.yaml:
position_adrc.td_rposition_adrc.eso_beta1/beta2/beta3/b0position_adrc.nlsef_k1/k2/alpha1/alpha2/deltaattitude_adrc.attitude_eso_beta1/beta2/beta3/b0attitude_adrc.attitude_nlsef_k1/k2/alpha1/alpha2/delta
The node publishes both /fmu/in/actuator_motors and /fmu/in/vehicle_thrust_setpoint when using direct_actuator.