Skip to content
Snippets Groups Projects
Commit fde1c061 authored by Beat Küng's avatar Beat Küng Committed by Lorenz Meier
Browse files

fix mavlink_mission: mission_set_current message only applies to MISSION_TYPE_MISSION

and thus the current _mission_type does not matter.
parent 6d85a3c4
No related branches found
No related tags found
No related merge requests found
......@@ -663,31 +663,14 @@ MavlinkMissionManager::handle_mission_set_current(const mavlink_message_t *msg)
if (_state == MAVLINK_WPM_STATE_IDLE) {
_time_last_recv = hrt_absolute_time();
if (wpc.seq < current_item_count()) {
switch (_mission_type) {
case MAV_MISSION_TYPE_MISSION:
if (update_active_mission(_dataman_id, _count[(uint8_t)_mission_type], wpc.seq) == PX4_OK) {
if (_verbose) { PX4_INFO("WPM: MISSION_SET_CURRENT seq=%d OK", wpc.seq); }
if (wpc.seq < _count[(uint8_t)MAV_MISSION_TYPE_MISSION]) {
if (update_active_mission(_dataman_id, _count[(uint8_t)MAV_MISSION_TYPE_MISSION], wpc.seq) == PX4_OK) {
if (_verbose) { PX4_INFO("WPM: MISSION_SET_CURRENT seq=%d OK", wpc.seq); }
} else {
if (_verbose) { PX4_ERR("WPM: MISSION_SET_CURRENT seq=%d ERROR", wpc.seq); }
_mavlink->send_statustext_critical("WPM: WP CURR CMD: Error setting ID");
}
break;
case MAV_MISSION_TYPE_FENCE:
update_geofence_count(_count[(uint8_t)_mission_type]);
break;
case MAV_MISSION_TYPE_RALLY:
update_safepoint_count(_count[(uint8_t)_mission_type]);
break;
} else {
if (_verbose) { PX4_ERR("WPM: MISSION_SET_CURRENT seq=%d ERROR", wpc.seq); }
default:
PX4_ERR("mission type %u not handled", (unsigned)_mission_type);
break;
_mavlink->send_statustext_critical("WPM: WP CURR CMD: Error setting ID");
}
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment