Navigator Fix: Do not set the closest mission item in normal mission mode (#9646)

- fixes #9606
This commit is contained in:
Florian Achermann
2018-06-12 12:11:14 -04:00
committed by Daniel Agar
parent 9151351b8d
commit 4697bf428b
+10 -2
View File
@@ -155,7 +155,11 @@ void
Mission::on_activation()
{
if (_mission_waypoints_changed) {
_current_offboard_mission_index = index_closest_mission_item();
// do not set the closest mission item in the normal mission mode
if (_mission_execution_mode != mission_result_s::MISSION_EXECUTION_MODE_NORMAL) {
_current_offboard_mission_index = index_closest_mission_item();
}
_mission_waypoints_changed = false;
}
@@ -199,7 +203,11 @@ Mission::on_active()
/* reset mission items if needed */
if (offboard_updated || _mission_waypoints_changed || _execution_mode_changed) {
if (_mission_waypoints_changed) {
_current_offboard_mission_index = index_closest_mission_item();
// do not set the closest mission item in the normal mission mode
if (_mission_execution_mode != mission_result_s::MISSION_EXECUTION_MODE_NORMAL) {
_current_offboard_mission_index = index_closest_mission_item();
}
_mission_waypoints_changed = false;
}