diff --git a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc index cf76d12af2..e8838fa6bb 100644 --- a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc +++ b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc @@ -33,24 +33,26 @@ PX4FirmwarePluginInstanceData::PX4FirmwarePluginInstanceData(QObject* parent) } PX4FirmwarePlugin::PX4FirmwarePlugin() - : _manualFlightMode (tr("Manual")) - , _acroFlightMode (tr("Acro")) - , _stabilizedFlightMode (tr("Stabilized")) - , _rattitudeFlightMode (tr("Rattitude")) - , _altCtlFlightMode (tr("Altitude")) - , _posCtlFlightMode (tr("Position")) - , _offboardFlightMode (tr("Offboard")) - , _readyFlightMode (tr("Ready")) - , _takeoffFlightMode (tr("Takeoff")) - , _holdFlightMode (tr("Hold")) - , _missionFlightMode (tr("Mission")) - , _rtlFlightMode (tr("Return")) - , _landingFlightMode (tr("Land")) - , _preclandFlightMode (tr("Precision Land")) - , _rtgsFlightMode (tr("Return to Groundstation")) - , _followMeFlightMode (tr("Follow Me")) - , _simpleFlightMode (tr("Simple")) - , _orbitFlightMode (tr("Orbit")) + : _manualFlightMode (tr("Manual")) + , _acroFlightMode (tr("Acro")) + , _stabilizedFlightMode (tr("Stabilized")) + , _rattitudeFlightMode (tr("Rattitude")) + , _altCtlFlightMode (tr("Altitude")) + , _posCtlFlightMode (tr("Position")) + , _offboardFlightMode (tr("Offboard")) + , _readyFlightMode (tr("Ready")) + , _takeoffFlightMode (tr("Takeoff")) + , _holdFlightMode (tr("Hold")) + , _missionFlightMode (tr("Mission")) + , _rtlFlightMode (tr("Return")) + , _landingFlightMode (tr("Land")) + , _preclandFlightMode (tr("Precision Land")) + , _rtgsFlightMode (tr("Return to Groundstation")) + , _followMeFlightMode (tr("Follow Me")) + , _simpleFlightMode (tr("Simple")) + , _orbitFlightMode (tr("Orbit")) + , _prismaManualFlightMode (tr("Prisma Manual")) + , _prismaOffboardFlightMode (tr("Prisma Offboard")) { qmlRegisterType ("QGroundControl.Controllers", 1, 0, "PX4SimpleFlightModesController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "AirframeComponentController"); @@ -75,16 +77,19 @@ PX4FirmwarePlugin::PX4FirmwarePlugin() { PX4_CUSTOM_MAIN_MODE_OFFBOARD, 0, true, false, true }, { PX4_CUSTOM_MAIN_MODE_SIMPLE, 0, false, false, true }, { PX4_CUSTOM_MAIN_MODE_POSCTL, PX4_CUSTOM_SUB_MODE_POSCTL_POSCTL, true, true, true }, - { PX4_CUSTOM_MAIN_MODE_POSCTL, PX4_CUSTOM_SUB_MODE_POSCTL_ORBIT, false, false, false }, + { PX4_CUSTOM_MAIN_MODE_POSCTL, PX4_CUSTOM_SUB_MODE_POSCTL_ORBIT, false, false, false}, { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_LOITER, true, true, true }, { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_MISSION, true, true, true }, { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_RTL, true, true, true }, { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_FOLLOW_TARGET, true, false, true }, { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_LAND, false, true, true }, - { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_PRECLAND, true, false, true }, + { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_PRECLAND, true, false, true }, { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_READY, false, true, true }, { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_RTGS, false, true, true }, { PX4_CUSTOM_MAIN_MODE_AUTO, PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF, false, true, true }, + { PX4_CUSTOM_MAIN_MODE_PRISMA, PX4_CUSTOM_SUB_MODE_PRISMA_MAN, true, true, true }, + { PX4_CUSTOM_MAIN_MODE_PRISMA, PX4_CUSTOM_SUB_MODE_PRISMA_1, true, false, true }, + }; // Must be in same order as above structure @@ -107,6 +112,8 @@ PX4FirmwarePlugin::PX4FirmwarePlugin() &_readyFlightMode, &_rtgsFlightMode, &_takeoffFlightMode, + &_prismaManualFlightMode, + &_prismaOffboardFlightMode, }; // Convert static information to dynamic list. This allows for plugin override class to manipulate list. diff --git a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h index a0a8d62ad4..74b7312331 100644 --- a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h +++ b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h @@ -42,6 +42,8 @@ class PX4FirmwarePlugin : public FirmwarePlugin QString takeControlFlightMode (void) const override { return _manualFlightMode; } QString gotoFlightMode (void) const override { return _holdFlightMode; } QString followFlightMode (void) const override { return _followMeFlightMode; }; + QString prismaManualFlightMode (void) const { return _prismaManualFlightMode; }; + QString prismaOffboardFlightMode (void) const { return _prismaOffboardFlightMode; }; void pauseVehicle (Vehicle* vehicle) override; void guidedModeRTL (Vehicle* vehicle, bool smartRTL) override; void guidedModeLand (Vehicle* vehicle) override; @@ -108,6 +110,8 @@ class PX4FirmwarePlugin : public FirmwarePlugin QString _followMeFlightMode; QString _simpleFlightMode; QString _orbitFlightMode; + QString _prismaManualFlightMode; + QString _prismaOffboardFlightMode; private slots: void _mavCommandResult(int vehicleId, int component, int command, int result, bool noReponseFromVehicle); diff --git a/src/FirmwarePlugin/PX4/px4_custom_mode.h b/src/FirmwarePlugin/PX4/px4_custom_mode.h index d829734bb3..adf580a234 100644 --- a/src/FirmwarePlugin/PX4/px4_custom_mode.h +++ b/src/FirmwarePlugin/PX4/px4_custom_mode.h @@ -51,7 +51,9 @@ enum PX4_CUSTOM_MAIN_MODE { PX4_CUSTOM_MAIN_MODE_OFFBOARD, PX4_CUSTOM_MAIN_MODE_STABILIZED, PX4_CUSTOM_MAIN_MODE_RATTITUDE, - PX4_CUSTOM_MAIN_MODE_SIMPLE /* unused, but reserved for future use */ + PX4_CUSTOM_MAIN_MODE_SIMPLE, /* unused, but reserved for future use */ + PX4_CUSTOM_MAIN_MODE_PRISMA + }; enum PX4_CUSTOM_SUB_MODE_AUTO { @@ -71,6 +73,11 @@ enum PX4_CUSTOM_SUB_MODE_POSCTL { PX4_CUSTOM_SUB_MODE_POSCTL_ORBIT }; +enum PX4_CUSTOM_SUB_MODE_PRISMA { + PX4_CUSTOM_SUB_MODE_PRISMA_1 = 1, + PX4_CUSTOM_SUB_MODE_PRISMA_MAN +}; + union px4_custom_mode { struct { uint16_t reserved;