mission: write next mission item into pos_sp_triplet->current if current mission item did not have position #13971
+9
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #13668
I was only able to reproduce the issue described when the drone is already flying.
The problem is that, if a new mission begins and it's first item is a command,
Mission::set_mission_items()
will not write topos_sp_triplet->current
, but that was markedinvalid
byreset_triplets()
.FlightTaskAuto
then goes into failsafe.https://github.com/PX4/Firmware/blob/master/src/modules/mc_pos_control/mc_pos_control_main.cpp#L564-L567
Additionally, depending on timing, the takeoff state machine uses NAN constraints to update its state, causing the state machine to fail to progress, which then makes it impossible to detect landing (we
will makehave a separate PR to guard against that: #13973).https://github.com/PX4/Firmware/blob/master/src/modules/mc_pos_control/mc_pos_control_main.cpp#L598