mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 18:33:33 +08:00
latlongcontrol: set lateral acc to 0 if NAN
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -271,6 +271,10 @@ void FwLateralLongitudinalControl::Run()
|
||||
_lat_control_sp.lateral_acceleration;
|
||||
}
|
||||
|
||||
if (!PX4_ISFINITE(lateral_accel_sp)) {
|
||||
lateral_accel_sp = 0.f; // mitigation if no valid setpoint is received: 0 lateral acceleration
|
||||
}
|
||||
|
||||
lateral_accel_sp = getCorrectedLateralAccelSetpoint(lateral_accel_sp);
|
||||
lateral_accel_sp = math::constrain(lateral_accel_sp, -_lateral_configuration.lateral_accel_max,
|
||||
_lateral_configuration.lateral_accel_max);
|
||||
|
||||
Reference in New Issue
Block a user