diff --git a/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc b/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc index 82964444bd79023e0d4c1b982edc068f1e58e37e..9f1e94478526792e4f1dfca74bf32ce91c106279 100644 --- a/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc +++ b/src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc @@ -66,7 +66,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void) _airframeComponent->setupTriggerSignals(); _components.append(QVariant::fromValue((VehicleComponent*)_airframeComponent)); - if ( !_vehicle->sub() ) { + if ( _vehicle->supportsRadio() ) { _radioComponent = new APMRadioComponent(_vehicle, this); _radioComponent->setupTriggerSignals(); _components.append(QVariant::fromValue((VehicleComponent*)_radioComponent)); diff --git a/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc b/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc index 9bd1445e51adf1402b199109f3c6469a05925d35..1818b5cf23a8445d48142fcb3c9bb9121709be7b 100644 --- a/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc +++ b/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc @@ -62,3 +62,8 @@ bool ArduSubFirmwarePlugin::supportsManualControl(void) { return true; } + +bool ArduSubFirmwarePlugin::supportsRadio(void) +{ + return false; +} diff --git a/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h b/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h index 15ec48c76139a35feed2ffddbbec443acdac749c..1f862ce4eeb7b34210812e2bfd10b2eac2cddb1d 100644 --- a/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h +++ b/src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h @@ -72,6 +72,8 @@ public: bool supportsThrottleModeCenterZero(void); bool supportsManualControl(void); + + bool supportsRadio(void); }; #endif diff --git a/src/FirmwarePlugin/FirmwarePlugin.cc b/src/FirmwarePlugin/FirmwarePlugin.cc index 7e96cbbe01011eab8aea4cc289cfce72f2dedcac..5e835f5fdffd92c97152ab6e903be09597e9f3b1 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.cc +++ b/src/FirmwarePlugin/FirmwarePlugin.cc @@ -94,6 +94,11 @@ bool FirmwarePlugin::supportsManualControl(void) return false; } +bool FirmwarePlugin::supportsRadio(void) +{ + return true; +} + bool FirmwarePlugin::adjustIncomingMavlinkMessage(Vehicle* vehicle, mavlink_message_t* message) { Q_UNUSED(vehicle); diff --git a/src/FirmwarePlugin/FirmwarePlugin.h b/src/FirmwarePlugin/FirmwarePlugin.h index aa73597fd940edf382f3668a752e8264231d0c3c..ecd6179e9d1b04b141a373bd49a3efaf025b5571 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.h +++ b/src/FirmwarePlugin/FirmwarePlugin.h @@ -137,6 +137,10 @@ public: /// By default, this returns false unless overridden in the firmware plugin. virtual bool supportsManualControl(void); + /// Returns true if the firmware supports the use of the RC radio and requires the RC radio + /// setup page. Returns true by default. + virtual bool supportsRadio(void); + /// Called before any mavlink message is processed by Vehicle such that the firmwre plugin /// can adjust any message characteristics. This is handy to adjust or differences in mavlink /// spec implementations such that the base code can remain mavlink generic. diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 53ce31129a1f606be843c07c9fdbc789f707cfe2..40982010e6c699365dc2d47a3ac8f259e9bf87cd 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1525,6 +1525,11 @@ bool Vehicle::supportsThrottleModeCenterZero(void) const return _firmwarePlugin->supportsThrottleModeCenterZero(); } +bool Vehicle::supportsRadio(void) const +{ + return _firmwarePlugin->supportsRadio(); +} + void Vehicle::_setCoordinateValid(bool coordinateValid) { if (coordinateValid != _coordinateValid) { diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index 7896adf06494175bdcecc0df644f43f2bb1433eb..90df74f65aa2817cd57a0922c4a361a98e535903 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -475,6 +475,7 @@ public: bool supportsManualControl(void) const; bool supportsThrottleModeCenterZero(void) const; + bool supportsRadio(void) const; void setFlying(bool flying); void setGuidedMode(bool guidedMode);