mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-04 05:05:19 +08:00
flight_mode_manager: invalidate dist to bottom/ground on terrain reset
- this allows the terrain hold to simply reset on the next valid update rather than trying to adjust the setpoints
This commit is contained in:
@@ -66,6 +66,8 @@ void FlightTask::_checkEkfResetCounters()
|
|||||||
if (_sub_vehicle_local_position.get().dist_bottom_reset_counter != _reset_counters.hagl) {
|
if (_sub_vehicle_local_position.get().dist_bottom_reset_counter != _reset_counters.hagl) {
|
||||||
_ekfResetHandlerHagl(_sub_vehicle_local_position.get().delta_dist_bottom);
|
_ekfResetHandlerHagl(_sub_vehicle_local_position.get().delta_dist_bottom);
|
||||||
_reset_counters.hagl = _sub_vehicle_local_position.get().dist_bottom_reset_counter;
|
_reset_counters.hagl = _sub_vehicle_local_position.get().dist_bottom_reset_counter;
|
||||||
|
|
||||||
|
_dist_to_bottom = NAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_sub_vehicle_local_position.get().vz_reset_counter != _reset_counters.vz) {
|
if (_sub_vehicle_local_position.get().vz_reset_counter != _reset_counters.vz) {
|
||||||
|
|||||||
@@ -279,6 +279,11 @@ void FlightTaskManualAltitude::_ekfResetHandlerHeading(float delta_psi)
|
|||||||
_stick_yaw.ekfResetHandler(delta_psi);
|
_stick_yaw.ekfResetHandler(delta_psi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FlightTaskManualAltitude::_ekfResetHandlerHagl(float delta_hagl)
|
||||||
|
{
|
||||||
|
_dist_to_ground_lock = NAN;
|
||||||
|
}
|
||||||
|
|
||||||
void FlightTaskManualAltitude::_updateSetpoints()
|
void FlightTaskManualAltitude::_updateSetpoints()
|
||||||
{
|
{
|
||||||
_stick_yaw.generateYawSetpoint(_yawspeed_setpoint, _yaw_setpoint, _sticks.getYawExpo(), _yaw, _deltatime, _unaided_yaw);
|
_stick_yaw.generateYawSetpoint(_yawspeed_setpoint, _yaw_setpoint, _sticks.getYawExpo(), _yaw, _deltatime, _unaided_yaw);
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _ekfResetHandlerHeading(float delta_psi) override; /**< adjust heading setpoint in case of EKF reset event */
|
void _ekfResetHandlerHeading(float delta_psi) override; /**< adjust heading setpoint in case of EKF reset event */
|
||||||
|
void _ekfResetHandlerHagl(float delta_hagl) override;
|
||||||
|
|
||||||
virtual void _updateSetpoints(); /**< updates all setpoints */
|
virtual void _updateSetpoints(); /**< updates all setpoints */
|
||||||
virtual void _scaleSticks(); /**< scales sticks to velocity in z */
|
virtual void _scaleSticks(); /**< scales sticks to velocity in z */
|
||||||
bool _checkTakeoff() override;
|
bool _checkTakeoff() override;
|
||||||
|
|||||||
Reference in New Issue
Block a user