mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 11:33:33 +08:00
make sure to update the reset counters every time the topic updates
Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
@@ -2293,7 +2293,6 @@ FixedwingPositionControl::task_main()
|
||||
if (_control_mode.flag_control_manual_enabled) {
|
||||
if (_control_mode.flag_control_altitude_enabled && _global_pos.alt_reset_counter != _alt_reset_counter) {
|
||||
_hold_alt += _global_pos.delta_alt;
|
||||
_alt_reset_counter = _global_pos.alt_reset_counter;
|
||||
// make TECS accept step in altitude and demanded altitude
|
||||
_tecs.handle_alt_step(_global_pos.delta_alt, _global_pos.alt);
|
||||
}
|
||||
@@ -2304,12 +2303,13 @@ FixedwingPositionControl::task_main()
|
||||
|
||||
// reset heading hold flag, which will re-initialise position control
|
||||
_hdg_hold_enabled = false;
|
||||
|
||||
// update reset counter
|
||||
_pos_reset_counter = _global_pos.lat_lon_reset_counter;
|
||||
}
|
||||
}
|
||||
|
||||
// update the reset counters in any case
|
||||
_alt_reset_counter = _global_pos.alt_reset_counter;
|
||||
_pos_reset_counter = _global_pos.lat_lon_reset_counter;
|
||||
|
||||
// XXX add timestamp check
|
||||
_global_pos_valid = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user