Body Rate¶
The toolkit computes an FRD body-rate request and collective thrust. PX4 retains body-rate feedback and allocation; the command is not a physical moment.
Desired rate and feedback command¶
The common specific force \(B=A/m\) determines \(R_d\). Analytic force/basis derivatives, using desired jerk and yaw rate, determine
Map the desired-frame angular velocity into the current FRD frame and add feedback:
\(K_{\mathrm{att}}\) is the diagonal vector attitude_gain, in s⁻¹; the output is current FRD rad/s. The desired rate alone is feedforward. The commanded rate adds a correction that PX4's rate loop then tracks. No inertia or \(\Omega\times J\Omega\) term enters this law.
Messages, scale, and timing¶
VehicleRatesSetpoint.roll, .pitch, and .yaw are commanded angular rates about forward/right/down axes, not Euler angles. thrust_body=(0,0,-u_T) uses
reset_integral=false leaves PX4 integral reset decisions to its native logic. Only OffboardControlMode.body_rate is true. The message uses publication time in microseconds.
The shared vehicle configuration requires mass and a curated hover-thrust scale, but mass cancels from this body-rate law. The command is clamped per axis to rate_limit_rad_s after attitude feedback. The current runtime evaluates full desired-attitude dynamics through snap before extracting \(\Omega_d\); angular-acceleration feedforward does not enter the published rate command. This computation uses stored measured angular velocity even though this handoff's readiness check does not require gyro receipt. The outer timer runs at control_rate_hz (100 Hz by default) after confirmed Offboard entry. See the shared startup and return behavior.
Run and interpret¶
In a separate repository-root shell, with an already airborne, state-ready SITL vehicle and no competing controller:
source ros2/runtime_env.sh
ros2 launch offboard_controllers se3.launch.py \
vehicle:=gz_f450 trajectory:=figure_eight_tracking handoff:=attitude_rate \
publish_diagnostics:=true record:=true
Compare desired/mapped rate, commanded rate, and measured rate to separate attitude feedback from PX4 rate tracking. Singular force/heading geometry limits analytic feedforward.
Read attitude_control.cpp, attitude_reference.cpp, and publication.cpp.