mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-03-24 10:34:00 +08:00
fix: RTL during mission after a landing
For delivery use-case, the mission contains a land item followed by other mission items. For the section after the land, the current sequence number is greater than the land start index. If an RTL is triggered, then isLanding returns true and the vehicle continues with the mission instead of executing the RTL. The land index marks the actual landing. So, is landing should only be true for the items between land_start_index and land_index. If there are items after the land index, then they don't belong to the landing anymore.
This commit is contained in:
committed by
Silvan Fuhrer
parent
6e1ab343f6
commit
6daec07bbe
@@ -384,7 +384,8 @@ MissionBase::on_active()
|
||||
bool
|
||||
MissionBase::isLanding()
|
||||
{
|
||||
if (hasMissionLandStart() && (_mission.current_seq > _mission.land_start_index)) {
|
||||
if (hasMissionLandStart() && (_mission.current_seq > _mission.land_start_index)
|
||||
&& (_mission.current_seq <= _mission.land_index)) {
|
||||
static constexpr size_t max_num_next_items{1u};
|
||||
int32_t next_mission_items_index[max_num_next_items];
|
||||
size_t num_found_items;
|
||||
|
||||
Reference in New Issue
Block a user