forked from Archive/PX4-Autopilot
fix mavlink_mission: mission_set_current message only applies to MISSION_TYPE_MISSION
and thus the current _mission_type does not matter.
This commit is contained in:
parent
6d85a3c4e4
commit
fde1c061ed
|
@ -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); }
|
||||
} 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;
|
||||
|
||||
default:
|
||||
PX4_ERR("mission type %u not handled", (unsigned)_mission_type);
|
||||
break;
|
||||
_mavlink->send_statustext_critical("WPM: WP CURR CMD: Error setting ID");
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue