2012-08-17 00:47:31 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file vehicleconfigurationsource.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
|
|
|
* @addtogroup
|
|
|
|
* @{
|
|
|
|
* @addtogroup VehicleConfigurationSource
|
|
|
|
* @{
|
|
|
|
* @brief
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* This program 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 this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VEHICLECONFIGURATIONSOURCE_H
|
|
|
|
#define VEHICLECONFIGURATIONSOURCE_H
|
|
|
|
|
|
|
|
#include <QString>
|
2012-09-04 01:28:28 +02:00
|
|
|
#include "actuatorsettings.h"
|
2012-08-17 00:47:31 +02:00
|
|
|
|
|
|
|
struct accelGyroBias {
|
|
|
|
float m_accelerometerXBias;
|
|
|
|
float m_accelerometerYBias;
|
|
|
|
float m_accelerometerZBias;
|
|
|
|
|
|
|
|
float m_gyroXBias;
|
|
|
|
float m_gyroYBias;
|
|
|
|
float m_gyroZBias;
|
|
|
|
};
|
|
|
|
|
2012-09-04 01:28:28 +02:00
|
|
|
struct actuatorChannelSettings {
|
2012-09-05 00:58:53 +02:00
|
|
|
quint16 channelMin;
|
|
|
|
quint16 channelNeutral;
|
|
|
|
quint16 channelMax;
|
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
// Default values
|
|
|
|
actuatorChannelSettings() : channelMin(1000), channelNeutral(1000), channelMax(1900) {}
|
2012-09-04 01:28:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
class VehicleConfigurationSource {
|
2012-08-17 00:47:31 +02:00
|
|
|
public:
|
|
|
|
VehicleConfigurationSource();
|
|
|
|
|
2014-08-18 01:20:31 +02:00
|
|
|
enum CONTROLLER_TYPE { CONTROLLER_UNKNOWN, CONTROLLER_CC, CONTROLLER_CC3D, CONTROLLER_REVO, CONTROLLER_NANO, CONTROLLER_OPLINK };
|
2013-05-19 17:37:30 +03:00
|
|
|
enum VEHICLE_TYPE { VEHICLE_UNKNOWN, VEHICLE_MULTI, VEHICLE_FIXEDWING, VEHICLE_HELI, VEHICLE_SURFACE };
|
|
|
|
enum VEHICLE_SUB_TYPE { MULTI_ROTOR_UNKNOWN, MULTI_ROTOR_TRI_Y, MULTI_ROTOR_QUAD_X, MULTI_ROTOR_QUAD_PLUS,
|
2014-07-10 06:01:28 +02:00
|
|
|
MULTI_ROTOR_HEXA, MULTI_ROTOR_HEXA_H, MULTI_ROTOR_HEXA_X, MULTI_ROTOR_HEXA_COAX_Y, MULTI_ROTOR_OCTO,
|
2014-07-13 13:58:18 +02:00
|
|
|
MULTI_ROTOR_OCTO_X, MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS,
|
2014-08-23 01:01:01 +10:00
|
|
|
FIXED_WING_DUAL_AILERON, FIXED_WING_AILERON, FIXED_WING_ELEVON, HELI_CCPM };
|
2014-08-23 02:00:11 +10:00
|
|
|
enum ESC_TYPE { ESC_RAPID, ESC_STANDARD, ESC_UNKNOWN };
|
2014-08-22 01:40:05 +02:00
|
|
|
enum SERVO_TYPE { SERVO_ANALOG, SERVO_DIGITAL, SERVO_UNKNOWN };
|
2013-05-19 17:37:30 +03:00
|
|
|
enum INPUT_TYPE { INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSMX10, INPUT_DSMX11, INPUT_DSM2, INPUT_UNKNOWN };
|
2012-08-17 00:47:31 +02:00
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
enum GPS_SETTING { GPS_UBX, GPS_NMEA, GPS_DISABLED };
|
|
|
|
enum RADIO_SETTING { RADIO_TELEMETRY, RADIO_DISABLED };
|
2013-04-07 11:52:33 +02:00
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
virtual VehicleConfigurationSource::CONTROLLER_TYPE getControllerType() const = 0;
|
2012-08-17 00:47:31 +02:00
|
|
|
virtual VehicleConfigurationSource::VEHICLE_TYPE getVehicleType() const = 0;
|
|
|
|
virtual VehicleConfigurationSource::VEHICLE_SUB_TYPE getVehicleSubType() const = 0;
|
2013-05-19 17:37:30 +03:00
|
|
|
virtual VehicleConfigurationSource::INPUT_TYPE getInputType() const = 0;
|
2014-08-22 01:40:05 +02:00
|
|
|
virtual VehicleConfigurationSource::ESC_TYPE getEscType() const = 0;
|
|
|
|
virtual VehicleConfigurationSource::SERVO_TYPE getServoType() const = 0;
|
2012-08-17 00:47:31 +02:00
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
virtual VehicleConfigurationSource::GPS_SETTING getGPSSetting() const = 0;
|
2013-04-07 11:52:33 +02:00
|
|
|
virtual VehicleConfigurationSource::RADIO_SETTING getRadioSetting() const = 0;
|
|
|
|
|
2013-04-16 19:41:13 +02:00
|
|
|
virtual bool isCalibrationPerformed() const = 0;
|
|
|
|
virtual accelGyroBias getCalibrationBias() const = 0;
|
2012-08-17 00:47:31 +02:00
|
|
|
|
2012-08-27 07:19:46 +02:00
|
|
|
virtual bool isMotorCalibrationPerformed() const = 0;
|
2012-09-09 23:44:42 +02:00
|
|
|
virtual QList<actuatorChannelSettings> getActuatorSettings() const = 0;
|
2012-08-17 00:47:31 +02:00
|
|
|
|
2012-09-16 15:14:47 +02:00
|
|
|
virtual bool isRestartNeeded() const = 0;
|
|
|
|
|
2013-05-19 17:37:30 +03:00
|
|
|
virtual QString getSummaryText() = 0;
|
2012-08-17 00:47:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VEHICLECONFIGURATIONSOURCE_H
|