Skip to content

Commit

Permalink
mission: write next mission item into pos_sp_triplet->current if curr…
Browse files Browse the repository at this point in the history
…ent mission item did not have position
  • Loading branch information
Nicolas de Palezieux committed Jan 20, 2020
1 parent c270e75 commit 0e30057
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/modules/navigator/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,15 @@ Mission::set_mission_items()
if (has_next_position_item) {
/* got next mission item, update setpoint triplet */
mission_apply_limitation(mission_item_next_position);
mission_item_to_position_setpoint(mission_item_next_position, &pos_sp_triplet->next);

if (pos_sp_triplet->current.valid) {
mission_item_to_position_setpoint(mission_item_next_position, &pos_sp_triplet->next);

} else {
mission_item_to_position_setpoint(mission_item_next_position, &pos_sp_triplet->current);
/* next mission item is not available */
pos_sp_triplet->next.valid = false;
}

} else {
/* next mission item is not available */
Expand Down

0 comments on commit 0e30057

Please sign in to comment.