mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-05 03:50:35 +08:00
FlightTaskAuto: reference update only if refence altitude has not bee set.
This commit is contained in:
committed by
Lorenz Meier
parent
45810ec2b4
commit
66d5f2ffd2
@@ -177,10 +177,13 @@ bool FlightTaskAuto::_isFinite(const position_setpoint_s sp)
|
||||
|
||||
void FlightTaskAuto::_evaluateVehicleGlobalPosition()
|
||||
{
|
||||
FlightTask::_evaluateVehicleLocalPosition();
|
||||
|
||||
// check if reference has changed and update.
|
||||
if (_sub_vehicle_local_position->get().ref_timestamp != _time_stamp_reference) {
|
||||
// Only update if reference timestamp has changed AND no valid reference altitude
|
||||
// is available.
|
||||
// TODO: this needs to be revisited and needs a more clear implementation
|
||||
if (_sub_vehicle_local_position->get().ref_timestamp != _time_stamp_reference &&
|
||||
(_sub_vehicle_local_position->get().z_global && !PX4_ISFINITE(_reference_altitude))) {
|
||||
|
||||
map_projection_init(&_reference_position,
|
||||
_sub_vehicle_local_position->get().ref_lat,
|
||||
_sub_vehicle_local_position->get().ref_lon);
|
||||
|
||||
Reference in New Issue
Block a user