feat(fw_att_control): magic numbers

This commit is contained in:
ttechnick
2026-03-03 10:41:12 +01:00
committed by Nick
parent fdf258c2aa
commit 7e5aca5540
4 changed files with 15 additions and 46 deletions

View File

@@ -299,7 +299,7 @@ void FwLateralLongitudinalControl::Run()
float roll_body = PX4_ISFINITE(roll_sp) ? roll_sp : 0.0f;
float pitch_body = PX4_ISFINITE(pitch_sp) ? pitch_sp : 0.0f;
float yaw_body = _yaw;
float yaw_body = _yaw + sinf(roll_body) * 0.45f;
const float thrust_body_x = PX4_ISFINITE(throttle_sp) ? throttle_sp : 0.0f;
@@ -610,6 +610,7 @@ void FwLateralLongitudinalControl::updateAttitude() {
const Eulerf euler_angles(R);
_long_control_state.pitch_rad = euler_angles.theta();
_yaw = euler_angles.psi();
_roll = euler_angles.phi();
// load factor due to banking
const float load_factor_from_bank_angle = 1.0f / max(cosf(euler_angles.phi()), FLT_EPSILON);