From 046f16e2089cefe8cf5c61f1ae42843e3c59ea3a Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sun, 12 Jun 2016 14:55:03 -0700 Subject: [PATCH] Fix MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES send/nack --- src/Vehicle/Vehicle.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 1bf55af..821e290 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -195,8 +195,8 @@ Vehicle::Vehicle(LinkInterface* link, connect(_parameterLoader, &ParameterLoader::parametersReady, _autopilotPlugin, &AutoPilotPlugin::_parametersReadyPreChecks); connect(_parameterLoader, &ParameterLoader::parameterListProgress, _autopilotPlugin, &AutoPilotPlugin::parameterListProgress); - // Ask the vehicle for firmware version info - doCommandLong(defaultComponentId(), MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES, 1 /* request firmware version */); + // Ask the vehicle for firmware version info. This must be MAV_COMP_ID_ALL since we don't know default component id yet. + doCommandLong(MAV_COMP_ID_ALL, MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES, 1 /* request firmware version */); _firmwarePlugin->initializeVehicle(this); @@ -467,6 +467,11 @@ void Vehicle::_handleCommandAck(mavlink_message_t& message) emit commandLongAck(message.compid, ack.command, ack.result); + if (ack.command == MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES) { + // Disregard failures + return; + } + QString commandName; MavCmdInfo* cmdInfo = qgcApp()->toolbox()->missionCommands()->getMavCmdInfo((MAV_CMD)ack.command, this); if (cmdInfo) {