Commit 8fdd2a38 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #3840 from bluerobotics/ardusubPluginWithXML

ArduSub Plugin: Basic Files + XML Update
parents c2b0c085 e9702e6f
......@@ -665,6 +665,7 @@ HEADERS+= \
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.h \
src/FirmwarePlugin/APM/ArduPlaneFirmwarePlugin.h \
src/FirmwarePlugin/APM/ArduRoverFirmwarePlugin.h \
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h \
src/FirmwarePlugin/PX4/px4_custom_mode.h \
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h \
src/FirmwarePlugin/PX4/PX4ParameterMetaData.h \
......@@ -723,6 +724,7 @@ SOURCES += \
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc \
src/FirmwarePlugin/APM/ArduPlaneFirmwarePlugin.cc \
src/FirmwarePlugin/APM/ArduRoverFirmwarePlugin.cc \
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc \
src/FirmwarePlugin/FirmwarePlugin.cc \
src/FirmwarePlugin/FirmwarePluginManager.cc \
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc \
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
/// @author Rustom Jehangir <rusty@bluerobotics.com>
#include "ArduSubFirmwarePlugin.h"
#include "QGCApplication.h"
#include "MissionManager.h"
APMSubMode::APMSubMode(uint32_t mode, bool settable) :
APMCustomMode(mode, settable)
{
QMap<uint32_t,QString> enumToString;
enumToString.insert(MANUAL, "Manual");
enumToString.insert(STABILIZE, "Stabilize");
enumToString.insert(ALT_HOLD, "Depth Hold");
setEnumToStringMapping(enumToString);
}
ArduSubFirmwarePlugin::ArduSubFirmwarePlugin(void)
{
QList<APMCustomMode> supportedFlightModes;
supportedFlightModes << APMSubMode(APMSubMode::MANUAL ,true);
supportedFlightModes << APMSubMode(APMSubMode::STABILIZE ,true);
supportedFlightModes << APMSubMode(APMSubMode::ALT_HOLD ,true);
setSupportedModes(supportedFlightModes);
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
/// @author Rustom Jehangir <rusty@bluerobotics.com>
#ifndef ArduSubFirmwarePlugin_H
#define ArduSubFirmwarePlugin_H
#include "APMFirmwarePlugin.h"
class APMSubMode : public APMCustomMode
{
public:
enum Mode {
STABILIZE = 0, // Hold level position
RESERVED_1 = 1,
ALT_HOLD = 2, // Depth hold
RESERVED_3 = 3,
RESERVED_4 = 4,
RESERVED_5 = 5,
RESERVED_6 = 6,
RESERVED_7 = 7,
RESERVED_8 = 8,
RESERVED_9 = 9,
RESERVED_10 = 10,
RESERVED_11 = 11,
RESERVED_12 = 12,
RESERVED_13 = 13,
RESERVED_14 = 14,
RESERVED_15 = 15,
RESERVED_16 = 16,
RESERVED_17 = 17,
RESERVED_18 = 18,
MANUAL = 19
};
static const int modeCount = 20;
APMSubMode(uint32_t mode, bool settable);
};
class ArduSubFirmwarePlugin : public APMFirmwarePlugin
{
Q_OBJECT
public:
ArduSubFirmwarePlugin(void);
// Overrides from FirmwarePlugin
};
#endif
......@@ -15,6 +15,7 @@
#include "APM/ArduCopterFirmwarePlugin.h"
#include "APM/ArduPlaneFirmwarePlugin.h"
#include "APM/ArduRoverFirmwarePlugin.h"
#include "APM/ArduSubFirmwarePlugin.h"
#include "PX4/PX4FirmwarePlugin.h"
FirmwarePluginManager::FirmwarePluginManager(QGCApplication* app)
......@@ -22,6 +23,7 @@ FirmwarePluginManager::FirmwarePluginManager(QGCApplication* app)
, _arduCopterFirmwarePlugin(NULL)
, _arduPlaneFirmwarePlugin(NULL)
, _arduRoverFirmwarePlugin(NULL)
, _arduSubFirmwarePlugin(NULL)
, _genericFirmwarePlugin(NULL)
, _px4FirmwarePlugin(NULL)
{
......@@ -33,6 +35,7 @@ FirmwarePluginManager::~FirmwarePluginManager()
delete _arduCopterFirmwarePlugin;
delete _arduPlaneFirmwarePlugin;
delete _arduRoverFirmwarePlugin;
delete _arduSubFirmwarePlugin;
delete _genericFirmwarePlugin;
delete _px4FirmwarePlugin;
}
......@@ -59,11 +62,15 @@ FirmwarePlugin* FirmwarePluginManager::firmwarePluginForAutopilot(MAV_AUTOPILOT
return _arduPlaneFirmwarePlugin;
case MAV_TYPE_GROUND_ROVER:
case MAV_TYPE_SURFACE_BOAT:
case MAV_TYPE_SUBMARINE:
if (!_arduRoverFirmwarePlugin) {
_arduRoverFirmwarePlugin = new ArduRoverFirmwarePlugin;
}
return _arduRoverFirmwarePlugin;
case MAV_TYPE_SUBMARINE:
if (!_arduSubFirmwarePlugin) {
_arduSubFirmwarePlugin = new ArduSubFirmwarePlugin;
}
return _arduSubFirmwarePlugin;
default:
break;
}
......
......@@ -24,6 +24,7 @@ class QGCApplication;
class ArduCopterFirmwarePlugin;
class ArduPlaneFirmwarePlugin;
class ArduRoverFirmwarePlugin;
class ArduSubFirmwarePlugin;
class PX4FirmwarePlugin;
/// FirmwarePluginManager is a singleton which is used to return the correct FirmwarePlugin for a MAV_AUTOPILOT type.
......@@ -49,6 +50,7 @@ private:
ArduCopterFirmwarePlugin* _arduCopterFirmwarePlugin;
ArduPlaneFirmwarePlugin* _arduPlaneFirmwarePlugin;
ArduRoverFirmwarePlugin* _arduRoverFirmwarePlugin;
ArduSubFirmwarePlugin* _arduSubFirmwarePlugin;
FirmwarePlugin* _genericFirmwarePlugin;
PX4FirmwarePlugin* _px4FirmwarePlugin;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment