Commit 6b464388 authored by Henry Zhang's avatar Henry Zhang Committed by Lorenz Meier

support MindPX v2. (#3382)

parent 06d30786
...@@ -80,6 +80,7 @@ public: ...@@ -80,6 +80,7 @@ public:
static const int boardIDPX4Flow = 6; ///< PX4 Flow board static const int boardIDPX4Flow = 6; ///< PX4 Flow board
static const int boardIDAeroCore = 98; ///< Gumstix AeroCore board static const int boardIDAeroCore = 98; ///< Gumstix AeroCore board
static const int boardID3DRRadio = 78; ///< 3DR Radio static const int boardID3DRRadio = 78; ///< 3DR Radio
static const int boardIDMINDPXFMUV2 = 88; ///< MindPX V2 board
signals: signals:
/// @brief Signals progress indicator for long running bootloader utility routines /// @brief Signals progress indicator for long running bootloader utility routines
......
...@@ -110,7 +110,7 @@ QGCView { ...@@ -110,7 +110,7 @@ QGCView {
} else { } else {
// We end up here when we detect a board plugged in after we've started upgrade // We end up here when we detect a board plugged in after we've started upgrade
statusTextArea.append(highlightPrefix + qsTr("Found device") + highlightSuffix + ": " + controller.boardType) statusTextArea.append(highlightPrefix + qsTr("Found device") + highlightSuffix + ": " + controller.boardType)
if (controller.boardType == "Pixhawk" || controller.boardType == "AeroCore" || controller.boardType == "PX4 Flow" || controller.boardType == "PX4 FMU V1") { if (controller.boardType == "Pixhawk" || controller.boardType == "AeroCore" || controller.boardType == "PX4 Flow" || controller.boardType == "PX4 FMU V1" || controller.boardType == "MindPX") {
showDialog(pixhawkFirmwareSelectDialog, title, qgcView.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) showDialog(pixhawkFirmwareSelectDialog, title, qgcView.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} }
} }
......
...@@ -143,6 +143,10 @@ void FirmwareUpgradeController::_foundBoard(bool firstAttempt, const QSerialPort ...@@ -143,6 +143,10 @@ void FirmwareUpgradeController::_foundBoard(bool firstAttempt, const QSerialPort
_foundBoardTypeName = "AeroCore"; _foundBoardTypeName = "AeroCore";
_startFlashWhenBootloaderFound = false; _startFlashWhenBootloaderFound = false;
break; break;
case QGCSerialPortInfo::BoardTypeMINDPXFMUV2:
_foundBoardTypeName = "MindPX";
_startFlashWhenBootloaderFound = false;
break;
case QGCSerialPortInfo::BoardTypePX4Flow: case QGCSerialPortInfo::BoardTypePX4Flow:
_foundBoardTypeName = "PX4 Flow"; _foundBoardTypeName = "PX4 Flow";
_startFlashWhenBootloaderFound = false; _startFlashWhenBootloaderFound = false;
...@@ -318,6 +322,12 @@ void FirmwareUpgradeController::_initFirmwareHash() ...@@ -318,6 +322,12 @@ void FirmwareUpgradeController::_initFirmwareHash()
{ AutoPilotStackAPM, DeveloperFirmware, RoverFirmware, "http://firmware.ardupilot.org/Rover/latest/PX4/APMrover2-v1.px4"} { AutoPilotStackAPM, DeveloperFirmware, RoverFirmware, "http://firmware.ardupilot.org/Rover/latest/PX4/APMrover2-v1.px4"}
}; };
//////////////////////////////////// MindPXFMUV2 firmwares //////////////////////////////////////////////////
FirmwareToUrlElement_t rgMindPXFMUV2FirmwareArray[] = {
{ AutoPilotStackPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/stable/mindpx-v2_default.px4"},
{ AutoPilotStackPX4, BetaFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/beta/mindpx-v2_default.px4"},
{ AutoPilotStackPX4, DeveloperFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/master/mindpx-v2_default.px4"},
};
/////////////////////////////// px4flow firmwares /////////////////////////////////////// /////////////////////////////// px4flow firmwares ///////////////////////////////////////
FirmwareToUrlElement_t rgPX4FLowFirmwareArray[] = { FirmwareToUrlElement_t rgPX4FLowFirmwareArray[] = {
{ PX4Flow, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Flow/master/px4flow.px4" }, { PX4Flow, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Flow/master/px4flow.px4" },
...@@ -353,6 +363,12 @@ void FirmwareUpgradeController::_initFirmwareHash() ...@@ -353,6 +363,12 @@ void FirmwareUpgradeController::_initFirmwareHash()
_rgPX4FMUV1Firmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); _rgPX4FMUV1Firmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url);
} }
size = sizeof(rgMindPXFMUV2FirmwareArray)/sizeof(rgMindPXFMUV2FirmwareArray[0]);
for (int i = 0; i < size; i++) {
const FirmwareToUrlElement_t& element = rgMindPXFMUV2FirmwareArray[i];
_rgMindPXFMUV2Firmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url);
}
size = sizeof(rgPX4FLowFirmwareArray)/sizeof(rgPX4FLowFirmwareArray[0]); size = sizeof(rgPX4FLowFirmwareArray)/sizeof(rgPX4FLowFirmwareArray[0]);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
const FirmwareToUrlElement_t& element = rgPX4FLowFirmwareArray[i]; const FirmwareToUrlElement_t& element = rgPX4FLowFirmwareArray[i];
...@@ -386,6 +402,8 @@ QHash<FirmwareUpgradeController::FirmwareIdentifier, QString>* FirmwareUpgradeCo ...@@ -386,6 +402,8 @@ QHash<FirmwareUpgradeController::FirmwareIdentifier, QString>* FirmwareUpgradeCo
return &_rgPX4FMUV4Firmware; return &_rgPX4FMUV4Firmware;
case Bootloader::boardIDAeroCore: case Bootloader::boardIDAeroCore:
return &_rgAeroCoreFirmware; return &_rgAeroCoreFirmware;
case Bootloader::boardIDMINDPXFMUV2:
return &_rgMindPXFMUV2Firmware;
case Bootloader::boardID3DRRadio: case Bootloader::boardID3DRRadio:
return &_rg3DRRadioFirmware; return &_rg3DRRadioFirmware;
default: default:
...@@ -410,6 +428,9 @@ QHash<FirmwareUpgradeController::FirmwareIdentifier, QString>* FirmwareUpgradeCo ...@@ -410,6 +428,9 @@ QHash<FirmwareUpgradeController::FirmwareIdentifier, QString>* FirmwareUpgradeCo
case QGCSerialPortInfo::BoardTypeAeroCore: case QGCSerialPortInfo::BoardTypeAeroCore:
boardId = Bootloader::boardIDAeroCore; boardId = Bootloader::boardIDAeroCore;
break; break;
case QGCSerialPortInfo::BoardTypeMINDPXFMUV2:
boardId = Bootloader::boardIDMINDPXFMUV2;
break;
case QGCSerialPortInfo::BoardTypePX4Flow: case QGCSerialPortInfo::BoardTypePX4Flow:
boardId = Bootloader::boardIDPX4Flow; boardId = Bootloader::boardIDPX4Flow;
break; break;
......
...@@ -197,6 +197,7 @@ private: ...@@ -197,6 +197,7 @@ private:
QHash<FirmwareIdentifier, QString> _rgPX4FMUV2Firmware; QHash<FirmwareIdentifier, QString> _rgPX4FMUV2Firmware;
QHash<FirmwareIdentifier, QString> _rgAeroCoreFirmware; QHash<FirmwareIdentifier, QString> _rgAeroCoreFirmware;
QHash<FirmwareIdentifier, QString> _rgPX4FMUV1Firmware; QHash<FirmwareIdentifier, QString> _rgPX4FMUV1Firmware;
QHash<FirmwareIdentifier, QString> _rgMindPXFMUV2Firmware;
QHash<FirmwareIdentifier, QString> _rgPX4FLowFirmware; QHash<FirmwareIdentifier, QString> _rgPX4FLowFirmware;
QHash<FirmwareIdentifier, QString> _rg3DRRadioFirmware; QHash<FirmwareIdentifier, QString> _rg3DRRadioFirmware;
......
...@@ -549,6 +549,12 @@ void LinkManager::_updateAutoConnectLinks(void) ...@@ -549,6 +549,12 @@ void LinkManager::_updateAutoConnectLinks(void)
pSerialConfig->setUsbDirect(true); pSerialConfig->setUsbDirect(true);
} }
break; break;
case QGCSerialPortInfo::BoardTypeMINDPXFMUV2:
if (_autoconnectPixhawk) {
pSerialConfig = new SerialConfiguration(QString("MindPX on %1").arg(portInfo.portName().trimmed()));
pSerialConfig->setUsbDirect(true);
}
break;
case QGCSerialPortInfo::BoardTypePX4Flow: case QGCSerialPortInfo::BoardTypePX4Flow:
if (_autoconnectPX4Flow) { if (_autoconnectPX4Flow) {
pSerialConfig = new SerialConfiguration(QString("PX4Flow on %1").arg(portInfo.portName().trimmed())); pSerialConfig = new SerialConfiguration(QString("PX4Flow on %1").arg(portInfo.portName().trimmed()));
......
...@@ -37,6 +37,7 @@ static const struct VIDPIDMapInfo_s { ...@@ -37,6 +37,7 @@ static const struct VIDPIDMapInfo_s {
{ QGCSerialPortInfo::px4VendorId, QGCSerialPortInfo::pixhawkFMUV1ProductId, QGCSerialPortInfo::BoardTypePX4FMUV1, "Found PX4 FMU V1" }, { QGCSerialPortInfo::px4VendorId, QGCSerialPortInfo::pixhawkFMUV1ProductId, QGCSerialPortInfo::BoardTypePX4FMUV1, "Found PX4 FMU V1" },
{ QGCSerialPortInfo::px4VendorId, QGCSerialPortInfo::px4FlowProductId, QGCSerialPortInfo::BoardTypePX4Flow, "Found PX4 Flow" }, { QGCSerialPortInfo::px4VendorId, QGCSerialPortInfo::px4FlowProductId, QGCSerialPortInfo::BoardTypePX4Flow, "Found PX4 Flow" },
{ QGCSerialPortInfo::px4VendorId, QGCSerialPortInfo::AeroCoreProductId, QGCSerialPortInfo::BoardTypeAeroCore, "Found AeroCore" }, { QGCSerialPortInfo::px4VendorId, QGCSerialPortInfo::AeroCoreProductId, QGCSerialPortInfo::BoardTypeAeroCore, "Found AeroCore" },
{ QGCSerialPortInfo::px4VendorId, QGCSerialPortInfo::MindPXFMUV2ProductId, QGCSerialPortInfo::BoardTypeMINDPXFMUV2,"Found MindPX FMU V2" },
{ QGCSerialPortInfo::threeDRRadioVendorId, QGCSerialPortInfo::threeDRRadioProductId, QGCSerialPortInfo::BoardTypeSikRadio, "Found SiK Radio" }, { QGCSerialPortInfo::threeDRRadioVendorId, QGCSerialPortInfo::threeDRRadioProductId, QGCSerialPortInfo::BoardTypeSikRadio, "Found SiK Radio" },
{ QGCSerialPortInfo::siLabsRadioVendorId, QGCSerialPortInfo::siLabsRadioProductId, QGCSerialPortInfo::BoardTypeSikRadio, "Found SiK Radio" }, { QGCSerialPortInfo::siLabsRadioVendorId, QGCSerialPortInfo::siLabsRadioProductId, QGCSerialPortInfo::BoardTypeSikRadio, "Found SiK Radio" },
{ QGCSerialPortInfo::ubloxRTKVendorId, QGCSerialPortInfo::ubloxRTKProductId, QGCSerialPortInfo::BoardTypeRTKGPS, "Found RTK GPS" }, { QGCSerialPortInfo::ubloxRTKVendorId, QGCSerialPortInfo::ubloxRTKProductId, QGCSerialPortInfo::BoardTypeRTKGPS, "Found RTK GPS" },
...@@ -90,6 +91,9 @@ QGCSerialPortInfo::BoardType_t QGCSerialPortInfo::boardType(void) const ...@@ -90,6 +91,9 @@ QGCSerialPortInfo::BoardType_t QGCSerialPortInfo::boardType(void) const
} else if (description().contains(QRegExp("PX4.*Flow", Qt::CaseInsensitive))) { } else if (description().contains(QRegExp("PX4.*Flow", Qt::CaseInsensitive))) {
qCDebug(QGCSerialPortInfoLog) << "Found possible px4 flow camera (by name matching fallback)"; qCDebug(QGCSerialPortInfoLog) << "Found possible px4 flow camera (by name matching fallback)";
boardType = BoardTypePX4Flow; boardType = BoardTypePX4Flow;
} else if (description() == "MindPX FMU v2.x" || description() == "MindPX BL FMU v2.x") {
qCDebug(QGCSerialPortInfoLog) << "Found MindPX FMU V2 (by name matching fallback)";
boardType = BoardTypeMINDPXFMUV2;
} else if (description() == "FT231X USB UART") { } else if (description() == "FT231X USB UART") {
qCDebug(QGCSerialPortInfoLog) << "Found possible Radio (by name matching fallback)"; qCDebug(QGCSerialPortInfoLog) << "Found possible Radio (by name matching fallback)";
boardType = BoardTypeSikRadio; boardType = BoardTypeSikRadio;
...@@ -121,7 +125,9 @@ bool QGCSerialPortInfo::boardTypePixhawk(void) const ...@@ -121,7 +125,9 @@ bool QGCSerialPortInfo::boardTypePixhawk(void) const
{ {
BoardType_t boardType = this->boardType(); BoardType_t boardType = this->boardType();
return boardType == BoardTypePX4FMUV1 || boardType == BoardTypePX4FMUV2 || boardType == BoardTypePX4FMUV4 || boardType == BoardTypeAeroCore; return boardType == BoardTypePX4FMUV1 || boardType == BoardTypePX4FMUV2
|| boardType == BoardTypePX4FMUV4 || boardType == BoardTypeAeroCore
|| boardType == BoardTypeMINDPXFMUV2;
} }
bool QGCSerialPortInfo::isBootloader(void) const bool QGCSerialPortInfo::isBootloader(void) const
......
...@@ -47,6 +47,7 @@ public: ...@@ -47,6 +47,7 @@ public:
BoardTypeSikRadio, BoardTypeSikRadio,
BoardTypeAeroCore, BoardTypeAeroCore,
BoardTypeRTKGPS, BoardTypeRTKGPS,
BoardTypeMINDPXFMUV2,
BoardTypeUnknown BoardTypeUnknown
} BoardType_t; } BoardType_t;
...@@ -63,6 +64,8 @@ public: ...@@ -63,6 +64,8 @@ public:
static const int px4FlowProductId = 21; ///< Product ID for PX4 Flow board static const int px4FlowProductId = 21; ///< Product ID for PX4 Flow board
static const int MindPXFMUV2ProductId = 48; ///< Product ID for the MindPX V2 board
static const int threeDRRadioVendorId = 1027; ///< Vendor ID for 3DR Radio static const int threeDRRadioVendorId = 1027; ///< Vendor ID for 3DR Radio
static const int threeDRRadioProductId = 24597; ///< Product ID for 3DR Radio static const int threeDRRadioProductId = 24597; ///< Product ID for 3DR Radio
......
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