Browse Source

AC_PosControl: set-alt-target-with-slew sets desired to 0 once at target

This resolves and issue with the set-alt-target-with-slew method leaving the z-axis desired velocity at the max speed-up or speed-down
this causes a jump in throttle if the user switches to Loiter after the vehicle has reached its target
master
Randy Mackay 6 years ago
parent
commit
ba3303dc61
  1. 3
      libraries/AC_AttitudeControl/AC_PosControl.cpp

3
libraries/AC_AttitudeControl/AC_PosControl.cpp

@ -286,6 +286,9 @@ void AC_PosControl::set_alt_target_with_slew(float alt_cm, float dt) @@ -286,6 +286,9 @@ void AC_PosControl::set_alt_target_with_slew(float alt_cm, float dt)
_pos_target.z += climb_rate_cms*dt;
_vel_desired.z = climb_rate_cms; // recorded for reporting purposes
}
} else {
// recorded for reporting purposes
_vel_desired.z = 0.0f;
}
// do not let target get too far from current altitude

Loading…
Cancel
Save