mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AR_AttitudeControl: get-steering-out-lat-accel uses negative speeds
This commit is contained in:
parent
5563691bd1
commit
fa76a7c904
@ -187,12 +187,13 @@ float AR_AttitudeControl::get_steering_out_lat_accel(float desired_accel, bool m
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
// only use positive speed. Use reverse flag instead of negative speeds.
|
||||
speed = fabsf(speed);
|
||||
|
||||
// enforce minimum speed to stop oscillations when first starting to move
|
||||
if (speed < AR_ATTCONTROL_STEER_SPEED_MIN) {
|
||||
speed = AR_ATTCONTROL_STEER_SPEED_MIN;
|
||||
if (fabsf(speed) < AR_ATTCONTROL_STEER_SPEED_MIN) {
|
||||
if (is_negative(speed)) {
|
||||
speed = -AR_ATTCONTROL_STEER_SPEED_MIN;
|
||||
} else {
|
||||
speed = AR_ATTCONTROL_STEER_SPEED_MIN;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate the desired steering rate given desired_accel and speed
|
||||
|
Loading…
Reference in New Issue
Block a user