mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 03:41:35 +08:00
takeoff: only set _can_loiter_at_sp if takeoff position has been set
Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -149,7 +149,12 @@ Takeoff::set_takeoff_position()
|
|||||||
memset(rep, 0, sizeof(*rep));
|
memset(rep, 0, sizeof(*rep));
|
||||||
}
|
}
|
||||||
|
|
||||||
_navigator->set_can_loiter_at_sp(true);
|
if (PX4_ISFINITE(pos_sp_triplet->current.lat) && PX4_ISFINITE(pos_sp_triplet->current.lon)) {
|
||||||
|
_navigator->set_can_loiter_at_sp(true);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_navigator->set_can_loiter_at_sp(false);
|
||||||
|
}
|
||||||
|
|
||||||
_navigator->set_position_setpoint_triplet_updated();
|
_navigator->set_position_setpoint_triplet_updated();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user