Skip to content

Offboard SE(3)

The ROS 2 SE(3) controller tracks a named trajectory and sends PX4 one of four command levels. Each level changes the feedback loops retained by PX4. Onboard SE3 is a separate native firmware mode.

Native and Offboard body-rate paths use mass-normalized translation gains directly (kx_over_mass, kv_over_mass) and a specific-force reference \(B=A/m\). Physical mass enters only the Offboard physical-wrench adapter and physical-force diagnostics. Both rate paths clamp requested rates per axis at their output boundary; match rate_limit_rad_s in ROS to native SE3_RATE_MAX, along with attitude gains, hover-thrust calibration, trajectories, state estimates and timing. The core laws match; invalid-command handling is not identical: native PX4 rejects a nonpositive collective projection, while Offboard clamps it to zero.

The geometric reference assumes an underactuated multirotor with one collective thrust axis. Position and heading determine a compatible attitude; this is not independent control of arbitrary position and attitude.

Choose a handoff

Handoff and law ROS command PX4 retains
acceleration NED acceleration and yaw Attitude/thrust conversion, attitude/rate loops, allocation
attitude Attitude and collective thrust Attitude/rate loops, allocation
attitude_rate Body rate and collective thrust Rate loop, allocation
thrust_and_torque · geometric_normalized Normalized torque and thrust Allocation
thrust_and_torque · geometric_physical Physical moment mapped to normalized commands Allocation
thrust_and_torque · px4_rate Reproduced rate PID output Allocation

thrust_and_torque supports three laws. Only geometric_physical computes an inertia-based moment in N·m; all three publish normalized PX4 commands. See the geometric mathematics.

Run

Follow Offboard control to prepare state, take off, choose entry behavior, and plan recovery. This node never arms or takes off. With a matching, airborne SITL vehicle near the configured trajectory start, use a separate Ubuntu repository-root shell:

source ros2/runtime_env.sh
ros2 launch offboard_controllers se3.launch.py \
  vehicle:=gz_f450 trajectory:=hover handoff:=acceleration \
  publish_diagnostics:=true

hover holds the configured NED [0, 0, -1] m and yaw 0 for 10 seconds. Other references are in Trajectories. Add record:=true to save a ROS bag under bags/se3/; recording_output overrides the destination.

Activation

offboard_trigger:=automatic is the default: after armed, valid state and warmup, the node requests Offboard and retries every second. offboard_trigger:=external waits for the pilot to select Offboard. Both start the trajectory clock only on PX4-confirmed Offboard entry in VehicleStatus.nav_state, not on launch or command acknowledgement. Neither option arms the aircraft.

During warmup SE3 publishes its heartbeat and diagnostic /se3/trajectory_reference, not the selected PX4 control setpoint. Setpoint publication begins after confirmed Offboard entry.

At trajectory completion, automatic mode requests Position, retrying every second while continuing control output. External mode holds the final trajectory reference and continues its feedback output until the pilot selects Position. A confirmed Position return completes the node. Returning to Position does not land or disarm.

Lifecycle

The outer wall timer runs at control_rate_hz (100 Hz by default). Only armed, state-ready iterations count toward the configured 1.5-second heartbeat warmup. Position/velocity validity is always required; attitude and angular-rate requirements depend on the handoff. hover additionally requires valid attitude, including with the acceleration handoff. The reproduced PX4 rate PID uses a separate gyro-sample clock for torque publication.

If required state becomes invalid or the aircraft disarms, the timer stops publishing its heartbeat/output and resets the warmup count. There is no finite initial-readiness or mode-return deadline in this implementation. These checks do not check sample age and are not a complete flight failsafe. PX4's configured Offboard-loss behavior remains relevant.

Losing Offboard invalidates the held PX4-rate target. A later accepted, ready Offboard entry restarts the trajectory at its configured absolute start. This differs from Offboard Position, which fails on an unexpected departure during tracking. Do not use re-entry as an automatic continuation of an interrupted trajectory. Confirm pilot control, land and disarm using the SITL exit procedure.

Vehicle support

The checked-in vehicle files provide mass and hover-thrust calibration for acceleration, attitude, body-rate, normalized-geometric, and PX4-rate control. geometric_physical additionally needs full propulsion and allocator data, currently available for gz_f450 only; its adapter supports four rotors. See Geometric (Physical) and Adding a vehicle.

Configuration and data

The launch reads gains, trajectories, and vehicle YAML from the checkout at startup (or installed packaged files outside a checkout). Restart after YAML edits. Offboard Staging uses installed configuration.

Gains and timing belong to controller.yaml; physical airframe/allocator data belong to the vehicle file. Keep the actual YAML or its hash with each recording because later trajectory edits change comparison boundaries. Diagnostics report calculated signals; analysis distinguishes references, measured state, and reconstructed quantities.

For implementation details, runtime/control.cpp selects each control boundary and runtime/lifecycle.cpp owns entry, timing, and return. The handoff pages explain the corresponding equations and message fields.