mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 03:23:33 +08:00
FW Positon control: do not use position_setpoint.valid to validate current position_setpoint
Instead of checking the .valid flag of position_setpoint, check for ISFINITE() of lat, lon, alt
when pulling the position_setpoint triplet. This fixes problems where the .valid flag didn't
reflect the proper state of the setpoint (e.g. .valid was true, .lat though NAN)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -222,6 +222,10 @@ private:
|
||||
vehicle_local_position_s _local_pos{};
|
||||
vehicle_status_s _vehicle_status{};
|
||||
|
||||
bool _position_setpoint_previous_valid{false};
|
||||
bool _position_setpoint_current_valid{false};
|
||||
bool _position_setpoint_next_valid{false};
|
||||
|
||||
perf_counter_t _loop_perf; // loop performance counter
|
||||
|
||||
// [us] Last absolute time position control has been called
|
||||
@@ -664,9 +668,8 @@ private:
|
||||
* May also change the position setpoint type depending on the desired behavior.
|
||||
*
|
||||
* @param now Current system time [us]
|
||||
* @param pos_sp_curr_valid True if the current position setpoint is valid
|
||||
*/
|
||||
void set_control_mode_current(const hrt_abstime &now, bool pos_sp_curr_valid);
|
||||
void set_control_mode_current(const hrt_abstime &now);
|
||||
|
||||
/**
|
||||
* @brief Compensate trim throttle for air density and vehicle weight.
|
||||
|
||||
Reference in New Issue
Block a user