mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 08:24:07 +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:
parent
b3afb325d8
commit
0779a0502c
@ -149,7 +149,12 @@ Takeoff::set_takeoff_position()
|
||||
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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user