1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

Merge branch 'master' into next

This commit is contained in:
Alessio Morale 2015-02-10 23:50:19 +01:00
commit 6ed06362a7
14 changed files with 4700 additions and 182 deletions

View File

@ -1,71 +1,66 @@
--- RELEASE-15.01 ---
--- RELEASE-15.01 --- Look Ma, No hands ---
This release mainly focuses on a new feature, GPSAssist which is a new form of assisted control for multirotors.
Assisted Control provides assistance functions on top of existing flight modes. GPSAssist is the
first assisted control option available from OpenPilot. GPSAssist supports Attitude and Rattitude
flight modes and activates braking and position hold when the pitch/roll sticks are centered. Attitude/Rattitude
flight modes and activates braking into position hold when the pitch/roll sticks are centered. Attitude/Rattitude
may be flown with any of the current thrust modes (manual, cruisecontrol, altvario). GPSAssist for the PositionHold
flight mode also introduces a braking sequence when first entering this flight mode and introduces altvario as the thrust mode.
The full list of features, improvements and bugfixes in this release is accessible here:
http://progress.openpilot.org/browse/OP/fixforversion/11020
http://progress.openpilot.org/issues/?filter=12062
Bug
[OP-1501] - Input wizard sets neutral point for throttle too low
[OP-1522] - Improve Robustness of OPLink radio
[OP-1530] - Prevent using unitialize channel ids
[OP-1537] - OPLink unreliable at high data rates
[OP-1579] - Add LDFLAGS to Makefile sanitized variables
[OP-1626] - Satellite dsm2/dsmX binding should depend on proper window timing.
[OP-1638] - Transmitter setup can strip servo gears.
[OP-1646] - QQmlExpression: Expression qrc:/welcome/qml/main.qml:125:23 depends on non-NOTIFYable properties:
[OP-1647] - Welcome QML type error
[OP-1653] - Qt 5.2.1 fixes
[OP-1654] - Linux libs rpath incorrect
[OP-1660] - RCinput manual calibration issue
[OP-1662] - SystemHealt more verbose
[OP-1670] - cruise control conflict with flight modes (rate & acro +)
[OP-1680] - OPLink control limited to 1000-1896
[OP-1681] - Fix debug build of GCS
[OP-1682] - Overflow issue with pwm rx and CC3D
[OP-1686] - Slave OPLM should receive PPM in PPM_only mode
Improvement
[OP-1256] - Add Erase Settings step to Vehicle Setup Wizard
[OP-1496] - Qt5.3.2 for OSX
[OP-1599] - rework position vario modes
[OP-1607] - Tab scaling on Vehicle Configuration pages is affected by clicking on "Ground" vehicle.
[OP-1611] - Add context menu to Scopes gadget.
[OP-1620] - Add fixed-wing Vtail to setup wizard
[OP-1622] - Update Ground config tab
[OP-1628] - Remove need to manually reboot by unplugging USB cable
[OP-1629] - Add erase settings check box (default checked) to wizard firmware page
[OP-1631] - Make erase Controller config a toolbar option
[OP-1645] - Change default arm and disarm times to be faster
[OP-1650] - Reduce telemetry to improve OPLink
[OP-1651] - Add GCS command line options to log to file
[OP-1652] - Rename WS2811_LED_Out pins
[OP-1657] - Linux bin wrapper not needed
[OP-1663] - Move Qt inside openpilotgcs lib dir to avoid conflict
[OP-1664] - Github pull request clang warnings
[OP-1666] - Tidy deb package
[OP-1667] - Remove firmware files from packages
[OP-1668] - Add a way to select source for the 'Curve 2' in the custom mixer tab.
[OP-1674] - Oplink setup : frequency display
** Bug
* [OP-1501] - Input wizard sets neutral point for throttle too low
* [OP-1579] - Add LDFLAGS to Makefile sanitized variables
* [OP-1626] - Satellite dsm2/dsmX binding should depend on proper window timing.
* [OP-1638] - Transmitter setup can strip servo gears.
* [OP-1646] - QQmlExpression: Expression qrc:/welcome/qml/main.qml:125:23 depends on non-NOTIFYable properties:
* [OP-1647] - Welcome QML type error
* [OP-1653] - Qt 5.2.1 fixes
* [OP-1654] - Linux libs rpath incorrect
* [OP-1660] - RCinput manual calibration issue
* [OP-1662] - SystemHealt more verbose
* [OP-1681] - Fix debug build of GCS
* [OP-1699] - Fix build issue with tagged linux release
* [OP-1701] - Fix linux Qt path config
New Feature
[OP-1503] - Yaffs2 file system library integration to Simposix
[OP-1637] - AssistedControl
[OP-1639] - Make non-git source
[OP-1640] - Write make install rule for Linux
[OP-1643] - Enable Ground Support in Wizard
Task
[OP-1557] - Update Qwt
[OP-1558] - Evaluate removal of: ground/openpilotgcs/src/plugins/pathactioneditor/pathactioneditor.qrc
[OP-1648] - Update PFD after flight mode changes
[OP-1656] - Upgrade to Qt 5.4.0
[OP-1684] - Fix warnings in Flight code
** Improvement
* [OP-1071] - Make map "emergency" lines less strong and dashed
* [OP-1256] - Add Erase Settings step to Vehicle Setup Wizard
* [OP-1496] - Qt5.3.2 for OSX
* [OP-1599] - rework position vario modes
* [OP-1607] - Tab scaling on Vehicle Configuration pages is affected by clicking on "Ground" vehicle.
* [OP-1611] - Add context menu to Scopes gadget.
* [OP-1620] - Add fixed-wing Vtail to setup wizard
* [OP-1622] - Update Ground config tab
* [OP-1628] - Remove need to manually reboot by unplugging USB cable
* [OP-1629] - Add erase settings check box (default checked) to wizard firmware page
* [OP-1652] - Rename WS2811_LED_Out pins
* [OP-1657] - Linux bin wrapper not needed
* [OP-1663] - Move Qt inside openpilotgcs lib dir to avoid conflict
* [OP-1664] - Github pull request clang warnings
* [OP-1666] - Tidy deb package
* [OP-1667] - Remove firmware files from packages
* [OP-1668] - Add a way to select source for the 'Curve 2' in the custom mixer tab.
* [OP-1674] - Oplink setup : frequency display
** New Feature
* [OP-1503] - Yaffs2 file system library integration to Simposix
* [OP-1637] - AssistedControl
* [OP-1639] - Make non-git source
* [OP-1640] - Write make install rule for Linux
* [OP-1643] - Enable Ground Support in Wizard
* [OP-1651] - Add GCS command line options to log to file
** Task
* [OP-1557] - Update Qwt
* [OP-1558] - Evaluate removal of: ground/openpilotgcs/src/plugins/pathactioneditor/pathactioneditor.qrc
* [OP-1648] - Update PFD after flight mode changes
* [OP-1656] - Upgrade to Qt 5.4.0
--- RELEASE-14.10 ---

View File

@ -0,0 +1,2154 @@
{
"battery": "3S",
"comment": "",
"controller": "CC3D",
"esc": "HK10A BLHELI",
"motor": "SS X2204 2300 KV",
"name": "ZMR250",
"nick": "ehitaja",
"objects": [
{
"fields": [
{
"name": "VbarSensitivity",
"type": "float32",
"unit": "frac",
"values": [
{
"name": "Roll",
"value": 0.5
},
{
"name": "Pitch",
"value": 0.5
},
{
"name": "Yaw",
"value": 0.5
}
]
},
{
"name": "VbarRollPI",
"type": "float32",
"unit": "1/(deg/s)",
"values": [
{
"name": "Kp",
"value": 0.004999999888241291
},
{
"name": "Ki",
"value": 0.0020000000949949026
}
]
},
{
"name": "VbarPitchPI",
"type": "float32",
"unit": "1/(deg/s)",
"values": [
{
"name": "Kp",
"value": 0.004999999888241291
},
{
"name": "Ki",
"value": 0.0020000000949949026
}
]
},
{
"name": "VbarYawPI",
"type": "float32",
"unit": "1/(deg/s)",
"values": [
{
"name": "Kp",
"value": 0.004999999888241291
},
{
"name": "Ki",
"value": 0.0020000000949949026
}
]
},
{
"name": "VbarTau",
"type": "float32",
"unit": "sec",
"values": [
{
"name": "0",
"value": 0.5
}
]
},
{
"name": "GyroTau",
"type": "float32",
"unit": "",
"values": [
{
"name": "0",
"value": 0.004999999888241291
}
]
},
{
"name": "DerivativeGamma",
"type": "float32",
"unit": "",
"values": [
{
"name": "0",
"value": 1
}
]
},
{
"name": "AxisLockKp",
"type": "float32",
"unit": "",
"values": [
{
"name": "0",
"value": 2.5
}
]
},
{
"name": "WeakLevelingKp",
"type": "float32",
"unit": "(deg/s)/deg",
"values": [
{
"name": "0",
"value": 0.10000000149011612
}
]
},
{
"name": "CruiseControlMaxPowerFactor",
"type": "float32",
"unit": "x",
"values": [
{
"name": "0",
"value": 3
}
]
},
{
"name": "CruiseControlPowerTrim",
"type": "float32",
"unit": "%",
"values": [
{
"name": "0",
"value": 100
}
]
},
{
"name": "CruiseControlPowerDelayComp",
"type": "float32",
"unit": "sec",
"values": [
{
"name": "0",
"value": 0.25
}
]
},
{
"name": "ScaleToAirspeed",
"type": "float32",
"unit": "m/s",
"values": [
{
"name": "0",
"value": 0
}
]
},
{
"name": "ScaleToAirspeedLimits",
"type": "float32",
"unit": "",
"values": [
{
"name": "Min",
"value": 0.05000000074505806
},
{
"name": "Max",
"value": 3
}
]
},
{
"name": "FlightModeMap",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Bank1"
},
{
"name": "1",
"value": "Bank2"
},
{
"name": "2",
"value": "Bank1"
},
{
"name": "3",
"value": "Bank1"
},
{
"name": "4",
"value": "Bank1"
},
{
"name": "5",
"value": "Bank1"
}
]
},
{
"name": "VbarGyroSuppress",
"type": "int8",
"unit": "%",
"values": [
{
"name": "0",
"value": 30
}
]
},
{
"name": "VbarPiroComp",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "FALSE"
}
]
},
{
"name": "VbarMaxAngle",
"type": "uint8",
"unit": "deg",
"values": [
{
"name": "0",
"value": 10
}
]
},
{
"name": "DerivativeCutoff",
"type": "uint8",
"unit": "Hz",
"values": [
{
"name": "0",
"value": 20
}
]
},
{
"name": "MaxAxisLock",
"type": "uint8",
"unit": "deg",
"values": [
{
"name": "0",
"value": 30
}
]
},
{
"name": "MaxAxisLockRate",
"type": "uint8",
"unit": "deg/s",
"values": [
{
"name": "0",
"value": 2
}
]
},
{
"name": "MaxWeakLevelingRate",
"type": "uint8",
"unit": "deg/s",
"values": [
{
"name": "0",
"value": 5
}
]
},
{
"name": "RattitudeModeTransition",
"type": "uint8",
"unit": "%",
"values": [
{
"name": "0",
"value": 80
}
]
},
{
"name": "CruiseControlMinThrust",
"type": "int8",
"unit": "%",
"values": [
{
"name": "0",
"value": 5
}
]
},
{
"name": "CruiseControlMaxThrust",
"type": "uint8",
"unit": "%",
"values": [
{
"name": "0",
"value": 90
}
]
},
{
"name": "CruiseControlMaxAngle",
"type": "uint8",
"unit": "deg",
"values": [
{
"name": "0",
"value": 105
}
]
},
{
"name": "CruiseControlFlightModeSwitchPosEnable",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "FALSE"
},
{
"name": "1",
"value": "FALSE"
},
{
"name": "2",
"value": "FALSE"
},
{
"name": "3",
"value": "FALSE"
},
{
"name": "4",
"value": "FALSE"
},
{
"name": "5",
"value": "FALSE"
}
]
},
{
"name": "CruiseControlInvertedThrustReversing",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Unreversed"
}
]
},
{
"name": "CruiseControlInvertedPowerOutput",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Zero"
}
]
},
{
"name": "LowThrottleZeroIntegral",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "TRUE"
}
]
}
],
"id": "236F6DEC",
"instance": 0,
"name": "StabilizationSettings",
"setting": true
},
{
"fields": [
{
"name": "ManualRate",
"type": "float32",
"unit": "degrees/sec",
"values": [
{
"name": "Roll",
"value": 300
},
{
"name": "Pitch",
"value": 300
},
{
"name": "Yaw",
"value": 180
}
]
},
{
"name": "MaximumRate",
"type": "float32",
"unit": "degrees/sec",
"values": [
{
"name": "Roll",
"value": 500
},
{
"name": "Pitch",
"value": 500
},
{
"name": "Yaw",
"value": 300
}
]
},
{
"name": "RollRatePID",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 0.0031000000890344381
},
{
"name": "Ki",
"value": 0.006399999838322401
},
{
"name": "Kd",
"value": 3.9999998989515007e-05
},
{
"name": "ILimit",
"value": 0.30000001192092896
}
]
},
{
"name": "PitchRatePID",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 0.0041000000201165676
},
{
"name": "Ki",
"value": 0.012500000186264515
},
{
"name": "Kd",
"value": 5.5000000429572538e-05
},
{
"name": "ILimit",
"value": 0.30000001192092896
}
]
},
{
"name": "YawRatePID",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 0.0076000001281499863
},
{
"name": "Ki",
"value": 0.012500000186264515
},
{
"name": "Kd",
"value": 4.9999998736893758e-05
},
{
"name": "ILimit",
"value": 0.30000001192092896
}
]
},
{
"name": "RollPI",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 3
},
{
"name": "Ki",
"value": 0
},
{
"name": "ILimit",
"value": 50
}
]
},
{
"name": "PitchPI",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 3.4000000953674316
},
{
"name": "Ki",
"value": 0
},
{
"name": "ILimit",
"value": 50
}
]
},
{
"name": "YawPI",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 2.5
},
{
"name": "Ki",
"value": 0
},
{
"name": "ILimit",
"value": 50
}
]
},
{
"name": "AcroInsanityFactor",
"type": "float32",
"unit": "percent",
"values": [
{
"name": "0",
"value": 0.5
}
]
},
{
"name": "ThrustPIDScaleCurve",
"type": "float32",
"unit": "percent",
"values": [
{
"name": "0",
"value": 0.18856613337993622
},
{
"name": "25",
"value": 0.094283066689968109
},
{
"name": "50",
"value": 0
},
{
"name": "75",
"value": -0.10285490751266479
},
{
"name": "100",
"value": -0.20282787084579468
}
]
},
{
"name": "RollMax",
"type": "uint8",
"unit": "degrees",
"values": [
{
"name": "0",
"value": 80
}
]
},
{
"name": "PitchMax",
"type": "uint8",
"unit": "degrees",
"values": [
{
"name": "0",
"value": 80
}
]
},
{
"name": "YawMax",
"type": "uint8",
"unit": "degrees",
"values": [
{
"name": "0",
"value": 35
}
]
},
{
"name": "StickExpo",
"type": "int8",
"unit": "percent",
"values": [
{
"name": "Roll",
"value": 13
},
{
"name": "Pitch",
"value": 13
},
{
"name": "Yaw",
"value": 0
}
]
},
{
"name": "EnablePiroComp",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "FALSE"
}
]
},
{
"name": "EnableThrustPIDScaling",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "TRUE"
}
]
},
{
"name": "ThrustPIDScaleSource",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "ActuatorDesiredThrust"
}
]
},
{
"name": "ThrustPIDScaleTarget",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "PD"
}
]
},
{
"name": "ThrustPIDScaleAxes",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Roll Pitch"
}
]
}
],
"id": "E8EBBD48",
"instance": 0,
"name": "StabilizationSettingsBank1",
"setting": true
},
{
"fields": [
{
"name": "ManualRate",
"type": "float32",
"unit": "degrees/sec",
"values": [
{
"name": "Roll",
"value": 400
},
{
"name": "Pitch",
"value": 400
},
{
"name": "Yaw",
"value": 220
}
]
},
{
"name": "MaximumRate",
"type": "float32",
"unit": "degrees/sec",
"values": [
{
"name": "Roll",
"value": 400
},
{
"name": "Pitch",
"value": 400
},
{
"name": "Yaw",
"value": 300
}
]
},
{
"name": "RollRatePID",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 0.0032999999821186066
},
{
"name": "Ki",
"value": 0.0076000001281499863
},
{
"name": "Kd",
"value": 3.600000127335079e-05
},
{
"name": "ILimit",
"value": 0.30000001192092896
}
]
},
{
"name": "PitchRatePID",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 0.0044999998062849045
},
{
"name": "Ki",
"value": 0.0093999998643994331
},
{
"name": "Kd",
"value": 4.5000000682193786e-05
},
{
"name": "ILimit",
"value": 0.30000001192092896
}
]
},
{
"name": "YawRatePID",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 0.0086000002920627594
},
{
"name": "Ki",
"value": 0.014299999922513962
},
{
"name": "Kd",
"value": 4.9999998736893758e-05
},
{
"name": "ILimit",
"value": 0.30000001192092896
}
]
},
{
"name": "RollPI",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 3
},
{
"name": "Ki",
"value": 0
},
{
"name": "ILimit",
"value": 50
}
]
},
{
"name": "PitchPI",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 3.4000000953674316
},
{
"name": "Ki",
"value": 0
},
{
"name": "ILimit",
"value": 50
}
]
},
{
"name": "YawPI",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 2.5
},
{
"name": "Ki",
"value": 0
},
{
"name": "ILimit",
"value": 50
}
]
},
{
"name": "AcroInsanityFactor",
"type": "float32",
"unit": "percent",
"values": [
{
"name": "0",
"value": 0.5
}
]
},
{
"name": "ThrustPIDScaleCurve",
"type": "float32",
"unit": "percent",
"values": [
{
"name": "0",
"value": 0.19285205006599426
},
{
"name": "25",
"value": 0.089997150003910065
},
{
"name": "50",
"value": 0
},
{
"name": "75",
"value": -0.08571123331785202
},
{
"name": "100",
"value": -0.18428021669387817
}
]
},
{
"name": "RollMax",
"type": "uint8",
"unit": "degrees",
"values": [
{
"name": "0",
"value": 55
}
]
},
{
"name": "PitchMax",
"type": "uint8",
"unit": "degrees",
"values": [
{
"name": "0",
"value": 55
}
]
},
{
"name": "YawMax",
"type": "uint8",
"unit": "degrees",
"values": [
{
"name": "0",
"value": 35
}
]
},
{
"name": "StickExpo",
"type": "int8",
"unit": "percent",
"values": [
{
"name": "Roll",
"value": 18
},
{
"name": "Pitch",
"value": 18
},
{
"name": "Yaw",
"value": -8
}
]
},
{
"name": "EnablePiroComp",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "FALSE"
}
]
},
{
"name": "EnableThrustPIDScaling",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "TRUE"
}
]
},
{
"name": "ThrustPIDScaleSource",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "ActuatorDesiredThrust"
}
]
},
{
"name": "ThrustPIDScaleTarget",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "PD"
}
]
},
{
"name": "ThrustPIDScaleAxes",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Roll Pitch"
}
]
}
],
"id": "70E9539A",
"instance": 0,
"name": "StabilizationSettingsBank2",
"setting": true
},
{
"fields": [
{
"name": "ManualRate",
"type": "float32",
"unit": "degrees/sec",
"values": [
{
"name": "Roll",
"value": 220
},
{
"name": "Pitch",
"value": 220
},
{
"name": "Yaw",
"value": 220
}
]
},
{
"name": "MaximumRate",
"type": "float32",
"unit": "degrees/sec",
"values": [
{
"name": "Roll",
"value": 300
},
{
"name": "Pitch",
"value": 300
},
{
"name": "Yaw",
"value": 300
}
]
},
{
"name": "RollRatePID",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 0.0024999999441206455
},
{
"name": "Ki",
"value": 0.0040000001899898052
},
{
"name": "Kd",
"value": 1.9999999494757503e-05
},
{
"name": "ILimit",
"value": 0.30000001192092896
}
]
},
{
"name": "PitchRatePID",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 0.0024999999441206455
},
{
"name": "Ki",
"value": 0.0040000001899898052
},
{
"name": "Kd",
"value": 1.9999999494757503e-05
},
{
"name": "ILimit",
"value": 0.30000001192092896
}
]
},
{
"name": "YawRatePID",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 0.0062000001780688763
},
{
"name": "Ki",
"value": 0.0099999997764825821
},
{
"name": "Kd",
"value": 4.9999998736893758e-05
},
{
"name": "ILimit",
"value": 0.30000001192092896
}
]
},
{
"name": "RollPI",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 2.5
},
{
"name": "Ki",
"value": 0
},
{
"name": "ILimit",
"value": 50
}
]
},
{
"name": "PitchPI",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 2.5
},
{
"name": "Ki",
"value": 0
},
{
"name": "ILimit",
"value": 50
}
]
},
{
"name": "YawPI",
"type": "float32",
"unit": "",
"values": [
{
"name": "Kp",
"value": 2.5
},
{
"name": "Ki",
"value": 0
},
{
"name": "ILimit",
"value": 50
}
]
},
{
"name": "AcroInsanityFactor",
"type": "float32",
"unit": "percent",
"values": [
{
"name": "0",
"value": 0.5
}
]
},
{
"name": "ThrustPIDScaleCurve",
"type": "float32",
"unit": "percent",
"values": [
{
"name": "0",
"value": 0.30000001192092896
},
{
"name": "25",
"value": 0.15000000596046448
},
{
"name": "50",
"value": 0
},
{
"name": "75",
"value": -0.15000000596046448
},
{
"name": "100",
"value": -0.30000001192092896
}
]
},
{
"name": "RollMax",
"type": "uint8",
"unit": "degrees",
"values": [
{
"name": "0",
"value": 55
}
]
},
{
"name": "PitchMax",
"type": "uint8",
"unit": "degrees",
"values": [
{
"name": "0",
"value": 55
}
]
},
{
"name": "YawMax",
"type": "uint8",
"unit": "degrees",
"values": [
{
"name": "0",
"value": 35
}
]
},
{
"name": "StickExpo",
"type": "int8",
"unit": "percent",
"values": [
{
"name": "Roll",
"value": 0
},
{
"name": "Pitch",
"value": 0
},
{
"name": "Yaw",
"value": 0
}
]
},
{
"name": "EnablePiroComp",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "TRUE"
}
]
},
{
"name": "EnableThrustPIDScaling",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "FALSE"
}
]
},
{
"name": "ThrustPIDScaleSource",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "ActuatorDesiredThrust"
}
]
},
{
"name": "ThrustPIDScaleTarget",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "PID"
}
]
},
{
"name": "ThrustPIDScaleAxes",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Roll Pitch"
}
]
}
],
"id": "C02DAA6A",
"instance": 0,
"name": "StabilizationSettingsBank3",
"setting": true
},
{
"fields": [
{
"name": "MaxAccel",
"type": "float32",
"unit": "units/sec",
"values": [
{
"name": "0",
"value": 1000
}
]
},
{
"name": "FeedForward",
"type": "float32",
"unit": "",
"values": [
{
"name": "0",
"value": 0
}
]
},
{
"name": "AccelTime",
"type": "float32",
"unit": "ms",
"values": [
{
"name": "0",
"value": 0
}
]
},
{
"name": "DecelTime",
"type": "float32",
"unit": "ms",
"values": [
{
"name": "0",
"value": 0
}
]
},
{
"name": "ThrottleCurve1",
"type": "float32",
"unit": "percent",
"values": [
{
"name": "0",
"value": 0
},
{
"name": "25",
"value": 0.22499999403953552
},
{
"name": "50",
"value": 0.44999998807907104
},
{
"name": "75",
"value": 0.67499995231628418
},
{
"name": "100",
"value": 0.89999997615814209
}
]
},
{
"name": "ThrottleCurve2",
"type": "float32",
"unit": "percent",
"values": [
{
"name": "0",
"value": 0
},
{
"name": "25",
"value": 0.22499999403953552
},
{
"name": "50",
"value": 0.44999998807907104
},
{
"name": "75",
"value": 0.67499995231628418
},
{
"name": "100",
"value": 0.89999997615814209
}
]
},
{
"name": "MixerValueRoll",
"type": "int8",
"unit": "percent",
"values": [
{
"name": "0",
"value": 50
}
]
},
{
"name": "MixerValuePitch",
"type": "int8",
"unit": "percent",
"values": [
{
"name": "0",
"value": 50
}
]
},
{
"name": "MixerValueYaw",
"type": "int8",
"unit": "percent",
"values": [
{
"name": "0",
"value": 50
}
]
},
{
"name": "Curve2Source",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Throttle"
}
]
},
{
"name": "Mixer1Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Motor"
}
]
},
{
"name": "Mixer1Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 127
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 64
},
{
"name": "Pitch",
"value": 64
},
{
"name": "Yaw",
"value": -64
}
]
},
{
"name": "Mixer2Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Motor"
}
]
},
{
"name": "Mixer2Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 127
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": -64
},
{
"name": "Pitch",
"value": 64
},
{
"name": "Yaw",
"value": 64
}
]
},
{
"name": "Mixer3Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Motor"
}
]
},
{
"name": "Mixer3Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 127
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": -64
},
{
"name": "Pitch",
"value": -64
},
{
"name": "Yaw",
"value": -64
}
]
},
{
"name": "Mixer4Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Motor"
}
]
},
{
"name": "Mixer4Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 127
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 64
},
{
"name": "Pitch",
"value": -64
},
{
"name": "Yaw",
"value": 64
}
]
},
{
"name": "Mixer5Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Disabled"
}
]
},
{
"name": "Mixer5Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 0
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 0
},
{
"name": "Pitch",
"value": 0
},
{
"name": "Yaw",
"value": 0
}
]
},
{
"name": "Mixer6Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Disabled"
}
]
},
{
"name": "Mixer6Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 0
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 0
},
{
"name": "Pitch",
"value": 0
},
{
"name": "Yaw",
"value": 0
}
]
},
{
"name": "Mixer7Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Disabled"
}
]
},
{
"name": "Mixer7Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 0
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 0
},
{
"name": "Pitch",
"value": 0
},
{
"name": "Yaw",
"value": 0
}
]
},
{
"name": "Mixer8Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Disabled"
}
]
},
{
"name": "Mixer8Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 0
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 0
},
{
"name": "Pitch",
"value": 0
},
{
"name": "Yaw",
"value": 0
}
]
},
{
"name": "Mixer9Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Disabled"
}
]
},
{
"name": "Mixer9Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 0
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 0
},
{
"name": "Pitch",
"value": 0
},
{
"name": "Yaw",
"value": 0
}
]
},
{
"name": "Mixer10Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Disabled"
}
]
},
{
"name": "Mixer10Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 0
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 0
},
{
"name": "Pitch",
"value": 0
},
{
"name": "Yaw",
"value": 0
}
]
},
{
"name": "Mixer11Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Disabled"
}
]
},
{
"name": "Mixer11Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 0
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 0
},
{
"name": "Pitch",
"value": 0
},
{
"name": "Yaw",
"value": 0
}
]
},
{
"name": "Mixer12Type",
"type": "enum",
"unit": "",
"values": [
{
"name": "0",
"value": "Disabled"
}
]
},
{
"name": "Mixer12Vector",
"type": "int8",
"unit": "",
"values": [
{
"name": "ThrottleCurve1",
"value": 0
},
{
"name": "ThrottleCurve2",
"value": 0
},
{
"name": "Roll",
"value": 0
},
{
"name": "Pitch",
"value": 0
},
{
"name": "Yaw",
"value": 0
}
]
}
],
"id": "7BF2CFA8",
"instance": 0,
"name": "MixerSettings",
"setting": true
},
{
"fields": [
{
"name": "P",
"type": "float32",
"unit": "1^2",
"values": [
{
"name": "PositionNorth",
"value": 10
},
{
"name": "PositionEast",
"value": 10
},
{
"name": "PositionDown",
"value": 10
},
{
"name": "VelocityNorth",
"value": 1
},
{
"name": "VelocityEast",
"value": 1
},
{
"name": "VelocityDown",
"value": 1
},
{
"name": "AttitudeQ1",
"value": 0.0070000002160668373
},
{
"name": "AttitudeQ2",
"value": 0.0070000002160668373
},
{
"name": "AttitudeQ3",
"value": 0.0070000002160668373
},
{
"name": "AttitudeQ4",
"value": 0.0070000002160668373
},
{
"name": "GyroDriftX",
"value": 9.9999999747524271e-07
},
{
"name": "GyroDriftY",
"value": 9.9999999747524271e-07
},
{
"name": "GyroDriftZ",
"value": 9.9999999747524271e-07
}
]
},
{
"name": "Q",
"type": "float32",
"unit": "1^2",
"values": [
{
"name": "GyroX",
"value": 0.0099999997764825821
},
{
"name": "GyroY",
"value": 0.0099999997764825821
},
{
"name": "GyroZ",
"value": 0.0099999997764825821
},
{
"name": "AccelX",
"value": 0.0099999997764825821
},
{
"name": "AccelY",
"value": 0.0099999997764825821
},
{
"name": "AccelZ",
"value": 0.0099999997764825821
},
{
"name": "GyroDriftX",
"value": 9.9999999747524271e-07
},
{
"name": "GyroDriftY",
"value": 9.9999999747524271e-07
},
{
"name": "GyroDriftZ",
"value": 9.9999999747524271e-07
}
]
},
{
"name": "R",
"type": "float32",
"unit": "1^2",
"values": [
{
"name": "GPSPosNorth",
"value": 1
},
{
"name": "GPSPosEast",
"value": 1
},
{
"name": "GPSPosDown",
"value": 1000000
},
{
"name": "GPSVelNorth",
"value": 0.0010000000474974513
},
{
"name": "GPSVelEast",
"value": 0.0010000000474974513
},
{
"name": "GPSVelDown",
"value": 0.0010000000474974513
},
{
"name": "MagX",
"value": 10
},
{
"name": "MagY",
"value": 10
},
{
"name": "MagZ",
"value": 10
},
{
"name": "BaroZ",
"value": 0.0099999997764825821
}
]
},
{
"name": "FakeR",
"type": "float32",
"unit": "1^2",
"values": [
{
"name": "FakeGPSPosIndoor",
"value": 10
},
{
"name": "FakeGPSVelIndoor",
"value": 1
},
{
"name": "FakeGPSVelAirspeed",
"value": 1000
}
]
}
],
"id": "5E91213C",
"instance": 0,
"name": "EKFConfiguration",
"setting": true
}
],
"owner": "Roman",
"propeller": "GF 5040/5030",
"servo": "",
"size": "250 mm",
"subtype": 2,
"type": 1,
"uuid": "{0fda3830-6fd3-4ceb-908b-dfac61e7adb8}",
"weight": "530g (with Mobius)"
}

View File

@ -33,6 +33,10 @@ win32 {
QMAKE_RPATHDIR = \'\$$ORIGIN\'/$$relative_path($$GCS_LIBRARY_PATH, $$GCS_APP_PATH)
QMAKE_RPATHDIR += \'\$$ORIGIN\'/$$relative_path($$GCS_QT_LIBRARY_PATH, $$GCS_APP_PATH)
include(../rpath.pri)
equals(copyqt, 1) {
RESOURCES += qtconf.qrc
}
}
OTHER_FILES += openpilotgcs.rc

View File

@ -0,0 +1,2 @@
[Paths]
Prefix = ../lib/openpilotgcs/qt5/

View File

@ -0,0 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="qt/etc/qt.conf">qt.conf</file>
</qresource>
</RCC>

View File

@ -0,0 +1,90 @@
/**
******************************************************************************
*
* @file oplinkwatchdog.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup [Group]
* @{
* @addtogroup OPLinkWatchdog
* @{
* @brief [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
*/
#include "oplinkwatchdog.h"
#include "extensionsystem/pluginmanager.h"
#include "uavobjects/uavobjectmanager.h"
#include "oplinkstatus.h"
#include <QDebug>
OPLinkWatchdog::OPLinkWatchdog() : QObject(),
m_isConnected(false)
{
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
Q_ASSERT(pm);
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
Q_ASSERT(objManager);
m_opLinkStatus = OPLinkStatus::GetInstance(objManager);
Q_ASSERT(m_opLinkStatus);
connect(m_opLinkStatus, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(onOPLinkStatusUpdate()));
m_watchdog = new QTimer(this);
connect(m_watchdog, SIGNAL(timeout()), this, SLOT(onTimeout()));
onOPLinkStatusUpdate();
}
OPLinkWatchdog::~OPLinkWatchdog()
{}
void OPLinkWatchdog::onOPLinkStatusUpdate()
{
m_watchdog->stop();
quint8 type = m_opLinkStatus->getBoardType();
if (!m_isConnected) {
switch (type) {
case 3:
m_opLinkType = OPLINK_MINI;
m_isConnected = true;
emit connected();
emit opLinkMiniConnected();
break;
case 9:
m_opLinkType = OPLINK_REVOLUTION;
m_isConnected = true;
emit connected();
emit opLinkRevolutionConnected();
break;
default:
m_isConnected = false;
m_opLinkType = OPLINK_UNKNOWN;
return;
}
qDebug() << "OPLinkWatchdog - OPLink connected";
}
m_watchdog->start(m_opLinkStatus->getMetadata().flightTelemetryUpdatePeriod * 3);
}
void OPLinkWatchdog::onTimeout()
{
if (m_isConnected) {
m_isConnected = false;
m_opLinkType = OPLINK_UNKNOWN;
qDebug() << "OPLinkWatchdog - OPLink disconnected";
emit disconnected();
}
}

View File

@ -0,0 +1,70 @@
/**
******************************************************************************
*
* @file oplinkwatchdog.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup [Group]
* @{
* @addtogroup OPLinkWatchdog
* @{
* @brief [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 OPLINKWATCHDOG_H
#define OPLINKWATCHDOG_H
#include <QTimer>
class OPLinkStatus;
class OPLinkWatchdog : public QObject {
Q_OBJECT
public:
enum OPLinkType {
OPLINK_MINI,
OPLINK_REVOLUTION,
OPLINK_UNKNOWN
};
OPLinkWatchdog();
~OPLinkWatchdog();
bool isConnected() const
{
return m_isConnected;
}
OPLinkWatchdog::OPLinkType opLinkType() const
{
return m_opLinkType;
}
signals:
void connected();
void opLinkMiniConnected();
void opLinkRevolutionConnected();
void disconnected();
private slots:
void onOPLinkStatusUpdate();
void onTimeout();
private:
bool m_isConnected;
OPLinkType m_opLinkType;
QTimer *m_watchdog;
OPLinkStatus *m_opLinkStatus;
};
#endif // OPLINKWATCHDOG_H

View File

@ -31,7 +31,8 @@ HEADERS += uploadergadget.h \
runningdevicewidget.h \
uploader_global.h \
enums.h \
rebootdialog.h
rebootdialog.h \
oplinkwatchdog.h
SOURCES += uploadergadget.cpp \
uploadergadgetconfiguration.cpp \
@ -46,7 +47,8 @@ SOURCES += uploadergadget.cpp \
SSP/qssp.cpp \
SSP/qsspt.cpp \
runningdevicewidget.cpp \
rebootdialog.cpp
rebootdialog.cpp \
oplinkwatchdog.cpp
OTHER_FILES += Uploader.pluginspec

View File

@ -27,8 +27,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>794</width>
<height>505</height>
<width>778</width>
<height>615</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@ -311,6 +311,9 @@ through serial or USB)</string>
<property name="text">
<string>Progress</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>

View File

@ -27,6 +27,7 @@
#include "uploadergadgetwidget.h"
#include "flightstatus.h"
#include "oplinkstatus.h"
#include "delay.h"
#include "devicewidget.h"
#include "runningdevicewidget.h"
@ -138,9 +139,10 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
{
m_config = new Ui_UploaderWidget();
m_config->setupUi(this);
currentStep = IAP_STATE_READY;
resetOnly = false;
dfu = NULL;
m_currentIAPStep = IAP_STATE_READY;
m_resetOnly = false;
m_dfu = NULL;
m_autoUpdateClosing = false;
// Listen to autopilot connection events
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
@ -245,7 +247,7 @@ void UploaderGadgetWidget::bootButtonsSetEnable(bool enabled)
m_config->safeBootButton->setEnabled(enabled);
// this feature is supported only on BL revision >= 4
bool isBL4 = ((dfu != NULL) && (dfu->devices[0].BL_Version >= 4));
bool isBL4 = ((m_dfu != NULL) && (m_dfu->devices[0].BL_Version >= 4));
m_config->eraseBootButton->setEnabled(isBL4 && enabled);
}
@ -292,7 +294,7 @@ void UploaderGadgetWidget::onAutopilotDisconnect()
m_config->haltButton->setEnabled(false);
m_config->resetButton->setEnabled(false);
bootButtonsSetEnable(true);
if (currentStep == IAP_STATE_BOOTLOADER) {
if (m_currentIAPStep == IAP_STATE_BOOTLOADER) {
m_config->rescueButton->setEnabled(false);
m_config->telemetryLink->setEnabled(false);
} else {
@ -322,7 +324,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
UAVObject *fwIAP = dynamic_cast<UAVDataObject *>(objManager->getObject("FirmwareIAPObj"));
switch (currentStep) {
switch (m_currentIAPStep) {
case IAP_STATE_READY:
m_config->haltButton->setEnabled(false);
getSerialPorts(); // Useful in case a new serial port appeared since the initial list,
@ -332,7 +334,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
fwIAP->getField("BoardRevision")->setDouble(0);
fwIAP->getField("BoardType")->setDouble(0);
connect(fwIAP, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(goToBootloader(UAVObject *, bool)));
currentStep = IAP_STATE_STEP_1;
m_currentIAPStep = IAP_STATE_STEP_1;
clearLog();
log("IAP Step 1");
fwIAP->updated();
@ -342,7 +344,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
if (!success) {
log("Oops, failure step 1");
log("Reset did NOT happen");
currentStep = IAP_STATE_READY;
m_currentIAPStep = IAP_STATE_READY;
disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(goToBootloader(UAVObject *, bool)));
m_config->haltButton->setEnabled(true);
emit progressUpdate(FAILURE, QVariant());
@ -351,7 +353,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
}
sleep(600);
fwIAP->getField("Command")->setValue("2233");
currentStep = IAP_STATE_STEP_2;
m_currentIAPStep = IAP_STATE_STEP_2;
log("IAP Step 2");
fwIAP->updated();
emit progressUpdate(JUMP_TO_BL, QVariant(2));
@ -360,7 +362,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
if (!success) {
log("Oops, failure step 2");
log("Reset did NOT happen");
currentStep = IAP_STATE_READY;
m_currentIAPStep = IAP_STATE_READY;
disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(goToBootloader(UAVObject *, bool)));
m_config->haltButton->setEnabled(true);
emit progressUpdate(FAILURE, QVariant());
@ -369,14 +371,14 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
}
sleep(600);
fwIAP->getField("Command")->setValue("3344");
currentStep = IAP_STEP_RESET;
m_currentIAPStep = IAP_STEP_RESET;
log("IAP Step 3");
emit progressUpdate(JUMP_TO_BL, QVariant(3));
fwIAP->updated();
break;
case IAP_STEP_RESET:
{
currentStep = IAP_STATE_READY;
m_currentIAPStep = IAP_STATE_READY;
if (!success) {
log("Oops, failure step 3");
log("Reset did NOT happen");
@ -407,36 +409,36 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(goToBootloader(UAVObject *, bool)));
currentStep = IAP_STATE_BOOTLOADER;
m_currentIAPStep = IAP_STATE_BOOTLOADER;
// Tell the mainboard to get into bootloader state:
log("Detecting devices, please wait a few seconds...");
if (!dfu) {
if (!m_dfu) {
if (dlj.startsWith("USB")) {
dfu = new DFUObject(DFU_DEBUG, false, QString());
m_dfu = new DFUObject(DFU_DEBUG, false, QString());
} else {
dfu = new DFUObject(DFU_DEBUG, true, getPortDevice(dli));
m_dfu = new DFUObject(DFU_DEBUG, true, getPortDevice(dli));
}
}
if (!dfu->ready()) {
if (!m_dfu->ready()) {
log("Could not enter DFU mode.");
delete dfu;
dfu = NULL;
delete m_dfu;
m_dfu = NULL;
cm->resumePolling();
currentStep = IAP_STATE_READY;
m_currentIAPStep = IAP_STATE_READY;
m_config->boardStatus->setText(tr("Bootloader?"));
m_config->haltButton->setEnabled(true);
emit progressUpdate(FAILURE, QVariant());
emit bootloaderFailed();
return;
}
dfu->AbortOperation();
if (!dfu->enterDFU(0)) {
m_dfu->AbortOperation();
if (!m_dfu->enterDFU(0)) {
log("Could not enter DFU mode.");
delete dfu;
dfu = NULL;
delete m_dfu;
m_dfu = NULL;
cm->resumePolling();
currentStep = IAP_STATE_READY;
m_currentIAPStep = IAP_STATE_READY;
m_config->boardStatus->setText(tr("Bootloader?"));
emit progressUpdate(FAILURE, QVariant());
emit bootloaderFailed();
@ -444,12 +446,12 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
}
sleep(500);
dfu->findDevices();
log(QString("Found %1 device(s).").arg(QString::number(dfu->numberOfDevices)));
if (dfu->numberOfDevices < 0 || dfu->numberOfDevices > 3) {
m_dfu->findDevices();
log(QString("Found %1 device(s).").arg(QString::number(m_dfu->numberOfDevices)));
if (m_dfu->numberOfDevices < 0 || m_dfu->numberOfDevices > 3) {
log("Inconsistent number of devices! Aborting");
delete dfu;
dfu = NULL;
delete m_dfu;
m_dfu = NULL;
cm->resumePolling();
emit progressUpdate(FAILURE, QVariant());
emit bootloaderFailed();
@ -461,11 +463,11 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
m_config->systemElements->removeTab(0);
delete qw;
}
for (int i = 0; i < dfu->numberOfDevices; i++) {
for (int i = 0; i < m_dfu->numberOfDevices; i++) {
DeviceWidget *dw = new DeviceWidget(this);
connectSignalSlot(dw);
dw->setDeviceID(i);
dw->setDfu(dfu);
dw->setDfu(m_dfu);
dw->populate();
m_config->systemElements->addTab(dw, tr("Device") + QString::number(i));
}
@ -477,8 +479,8 @@ void UploaderGadgetWidget::goToBootloader(UAVObject *callerObj, bool success)
emit progressUpdate(JUMP_TO_BL, QVariant(5));
emit bootloaderSuccess();
if (resetOnly) {
resetOnly = false;
if (m_resetOnly) {
m_resetOnly = false;
delay::msleep(3500);
systemBoot();
break;
@ -518,10 +520,10 @@ void UploaderGadgetWidget::systemReset()
// The board can not be reset when in armed state.
// If board is armed, or arming. Show message with notice.
if (status->getArmed() == FlightStatus::ARMED_DISARMED) {
resetOnly = true;
if (dfu) {
delete dfu;
dfu = NULL;
m_resetOnly = true;
if (m_dfu) {
delete m_dfu;
m_dfu = NULL;
}
clearLog();
log("Board Reset initiated.");
@ -618,31 +620,31 @@ void UploaderGadgetWidget::commonSystemBoot(bool safeboot, bool erase)
log("Attempting to boot the system through " + devName + ".");
repaint();
if (!dfu) {
if (!m_dfu) {
if (devName == "USB") {
dfu = new DFUObject(DFU_DEBUG, false, QString());
m_dfu = new DFUObject(DFU_DEBUG, false, QString());
} else {
dfu = new DFUObject(DFU_DEBUG, true, getPortDevice(devName));
m_dfu = new DFUObject(DFU_DEBUG, true, getPortDevice(devName));
}
}
dfu->AbortOperation();
if (!dfu->enterDFU(0)) {
m_dfu->AbortOperation();
if (!m_dfu->enterDFU(0)) {
log("Could not enter DFU mode.");
delete dfu;
dfu = NULL;
delete m_dfu;
m_dfu = NULL;
bootButtonsSetEnable(true);
m_config->rescueButton->setEnabled(true); // Boot not possible, maybe Rescue OK?
emit bootFailed();
return;
}
log("Booting system...");
dfu->JumpToApp(safeboot, erase);
m_dfu->JumpToApp(safeboot, erase);
// Restart the polling thread
cm->resumePolling();
m_config->rescueButton->setEnabled(true);
m_config->telemetryLink->setEnabled(true);
m_config->boardStatus->setText(tr("Running"));
if (currentStep == IAP_STATE_BOOTLOADER) {
if (m_currentIAPStep == IAP_STATE_BOOTLOADER) {
// Freeze the tabs, they are not useful anymore and their buttons
// will cause segfaults or weird stuff if we use them.
for (int i = 0; i < m_config->systemElements->count(); i++) {
@ -657,11 +659,11 @@ void UploaderGadgetWidget::commonSystemBoot(bool safeboot, bool erase)
}
}
}
currentStep = IAP_STATE_READY;
m_currentIAPStep = IAP_STATE_READY;
log("You can now reconnect telemetry...");
delete dfu; // Frees up the USB/Serial port too
delete m_dfu; // Frees up the USB/Serial port too
emit bootSuccess();
dfu = NULL;
m_dfu = NULL;
}
bool UploaderGadgetWidget::autoUpdateCapable()
@ -671,8 +673,15 @@ bool UploaderGadgetWidget::autoUpdateCapable()
bool UploaderGadgetWidget::autoUpdate(bool erase)
{
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
if (m_oplinkwatchdog.isConnected() &&
m_oplinkwatchdog.opLinkType() == OPLinkWatchdog::OPLINK_MINI) {
emit progressUpdate(FAILURE, QVariant(tr("To upgrade the OPLinkMini board please disconnect it from the USB port, "
"press the Upgrade again button and follow instructions on screen.")));
emit autoUpdateFailed();
return false;
}
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
Q_ASSERT(pluginManager);
TelemetryManager *telemetryManager = pluginManager->getObject<TelemetryManager>();
Q_ASSERT(telemetryManager);
@ -717,20 +726,20 @@ bool UploaderGadgetWidget::autoUpdate(bool erase)
disconnect(this, SIGNAL(bootloaderFailed()), &eventLoop, SLOT(fail()));
}
if (dfu) {
delete dfu;
dfu = NULL;
if (m_dfu) {
delete m_dfu;
m_dfu = NULL;
}
Core::ConnectionManager *connectionManager = Core::ICore::instance()->connectionManager();
dfu = new DFUObject(DFU_DEBUG, false, QString());
dfu->AbortOperation();
m_dfu = new DFUObject(DFU_DEBUG, false, QString());
m_dfu->AbortOperation();
emit progressUpdate(JUMP_TO_BL, QVariant());
if (!dfu->enterDFU(0) || !dfu->findDevices() ||
(dfu->numberOfDevices != 1) || dfu->numberOfDevices > 5) {
delete dfu;
dfu = NULL;
if (!m_dfu->enterDFU(0) || !m_dfu->findDevices() ||
(m_dfu->numberOfDevices != 1) || m_dfu->numberOfDevices > 5) {
delete m_dfu;
m_dfu = NULL;
connectionManager->resumePolling();
emit progressUpdate(FAILURE, QVariant(tr("Failed to enter bootloader mode.")));
emit autoUpdateFailed();
@ -739,7 +748,7 @@ bool UploaderGadgetWidget::autoUpdate(bool erase)
QString filename;
emit progressUpdate(LOADING_FW, QVariant());
switch (dfu->devices[0].ID) {
switch (m_dfu->devices[0].ID) {
case 0x301:
filename = "fw_oplinkmini";
break;
@ -760,7 +769,7 @@ bool UploaderGadgetWidget::autoUpdate(bool erase)
filename = "fw_discoveryf4bare";
break;
default:
emit progressUpdate(FAILURE, QVariant(tr("Unknown board id '0x%1'").arg(QString::number(dfu->devices[0].ID, 16))));
emit progressUpdate(FAILURE, QVariant(tr("Unknown board id '0x%1'").arg(QString::number(m_dfu->devices[0].ID, 16))));
emit autoUpdateFailed();
return false;
}
@ -779,16 +788,16 @@ bool UploaderGadgetWidget::autoUpdate(bool erase)
}
firmware = file.readAll();
QEventLoop eventLoop2;
connect(dfu, SIGNAL(progressUpdated(int)), this, SLOT(autoUpdateFlashProgress(int)));
connect(dfu, SIGNAL(uploadFinished(OP_DFU::Status)), &eventLoop2, SLOT(quit()));
connect(m_dfu, SIGNAL(progressUpdated(int)), this, SLOT(autoUpdateFlashProgress(int)));
connect(m_dfu, SIGNAL(uploadFinished(OP_DFU::Status)), &eventLoop2, SLOT(quit()));
emit progressUpdate(UPLOADING_FW, QVariant());
if (!dfu->enterDFU(0)) {
if (!m_dfu->enterDFU(0)) {
emit progressUpdate(FAILURE, QVariant(tr("Could not enter direct firmware upload mode.")));
emit autoUpdateFailed();
return false;
}
dfu->AbortOperation();
if (!dfu->UploadFirmware(filename, false, 0)) {
m_dfu->AbortOperation();
if (!m_dfu->UploadFirmware(filename, false, 0)) {
emit progressUpdate(FAILURE, QVariant(tr("Firmware upload failed.")));
emit autoUpdateFailed();
return false;
@ -796,7 +805,7 @@ bool UploaderGadgetWidget::autoUpdate(bool erase)
eventLoop2.exec();
QByteArray desc = firmware.right(100);
emit progressUpdate(UPLOADING_DESC, QVariant());
if (dfu->UploadDescription(desc) != OP_DFU::Last_operation_Success) {
if (m_dfu->UploadDescription(desc) != OP_DFU::Last_operation_Success) {
emit progressUpdate(FAILURE, QVariant(tr("Failed to upload firmware description.")));
emit autoUpdateFailed();
return false;
@ -806,10 +815,12 @@ bool UploaderGadgetWidget::autoUpdate(bool erase)
// Wait for board to connect to GCS again after boot and erase
// For older board like CC3D this can take some time
if (!telemetryManager->isConnected()) {
// Theres a special case with OPLink
if (!telemetryManager->isConnected() && !m_oplinkwatchdog.isConnected()) {
progressUpdate(erase ? BOOTING_AND_ERASING : BOOTING, QVariant());
ResultEventLoop eventLoop;
connect(telemetryManager, SIGNAL(connected()), &eventLoop, SLOT(success()));
connect(&m_oplinkwatchdog, SIGNAL(opLinkMiniConnected()), &eventLoop, SLOT(success()));
if (eventLoop.run(REBOOT_TIMEOUT + (erase ? ERASE_TIMEOUT : 0)) != 0) {
emit progressUpdate(FAILURE, QVariant(tr("Timed out while booting.")));
@ -817,6 +828,7 @@ bool UploaderGadgetWidget::autoUpdate(bool erase)
return false;
}
disconnect(&m_oplinkwatchdog, SIGNAL(opLinkMiniConnected()), &eventLoop, SLOT(success()));
disconnect(telemetryManager, SIGNAL(connected()), &eventLoop, SLOT(success()));
}
@ -861,9 +873,9 @@ void UploaderGadgetWidget::systemRescue()
// Existing DFU objects will have a handle over USB and will
// disturb everything for the rescue process:
if (dfu) {
delete dfu;
dfu = NULL;
if (m_dfu) {
delete m_dfu;
m_dfu = NULL;
}
// Avoid users pressing Rescue twice.
@ -907,39 +919,39 @@ void UploaderGadgetWidget::systemRescue()
}
log("Detecting first board...");
dfu = new DFUObject(DFU_DEBUG, false, QString());
dfu->AbortOperation();
if (!dfu->enterDFU(0)) {
m_dfu = new DFUObject(DFU_DEBUG, false, QString());
m_dfu->AbortOperation();
if (!m_dfu->enterDFU(0)) {
log("Could not enter DFU mode.");
delete dfu;
dfu = NULL;
delete m_dfu;
m_dfu = NULL;
cm->resumePolling();
m_config->rescueButton->setEnabled(true);
return;
}
if (!dfu->findDevices() || (dfu->numberOfDevices != 1)) {
if (!m_dfu->findDevices() || (m_dfu->numberOfDevices != 1)) {
log("Could not detect a board, aborting!");
delete dfu;
dfu = NULL;
delete m_dfu;
m_dfu = NULL;
cm->resumePolling();
m_config->rescueButton->setEnabled(true);
return;
}
log(QString("Found %1 device(s).").arg(dfu->numberOfDevices));
log(QString("Found %1 device(s).").arg(m_dfu->numberOfDevices));
if (dfu->numberOfDevices > 5) {
if (m_dfu->numberOfDevices > 5) {
log("Inconsistent number of devices, aborting!");
delete dfu;
dfu = NULL;
delete m_dfu;
m_dfu = NULL;
cm->resumePolling();
m_config->rescueButton->setEnabled(true);
return;
}
for (int i = 0; i < dfu->numberOfDevices; i++) {
for (int i = 0; i < m_dfu->numberOfDevices; i++) {
DeviceWidget *dw = new DeviceWidget(this);
connectSignalSlot(dw);
dw->setDeviceID(i);
dw->setDfu(dfu);
dw->setDfu(m_dfu);
dw->populate();
m_config->systemElements->addTab(dw, tr("Device") + QString::number(i));
}
@ -949,7 +961,7 @@ void UploaderGadgetWidget::systemRescue()
m_config->rescueButton->setEnabled(false);
// So that we can boot from the GUI afterwards.
currentStep = IAP_STATE_BOOTLOADER;
m_currentIAPStep = IAP_STATE_BOOTLOADER;
}
void UploaderGadgetWidget::uploadStarted()
@ -1017,6 +1029,7 @@ void UploaderGadgetWidget::finishAutoUpdate()
{
disconnect(this, SIGNAL(progressUpdate(uploader::ProgressStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::ProgressStep, QVariant)));
m_config->autoUpdateOkButton->setEnabled(true);
m_autoUpdateClosing = true;
// wait a bit and "close" auto update
QTimer::singleShot(AUTOUPDATE_CLOSE_TIMEOUT, this, SLOT(closeAutoUpdate()));
@ -1024,9 +1037,12 @@ void UploaderGadgetWidget::finishAutoUpdate()
void UploaderGadgetWidget::closeAutoUpdate()
{
m_config->autoUpdateGroupBox->setVisible(false);
m_config->buttonFrame->setEnabled(true);
m_config->splitter->setEnabled(true);
if (m_autoUpdateClosing) {
m_config->autoUpdateGroupBox->setVisible(false);
m_config->buttonFrame->setEnabled(true);
m_config->splitter->setEnabled(true);
}
m_autoUpdateClosing = false;
}
void UploaderGadgetWidget::autoUpdateStatus(uploader::ProgressStep status, QVariant value)

View File

@ -35,12 +35,15 @@
#include "op_dfu.h"
#include <QProgressDialog>
#include "oplinkwatchdog.h"
using namespace OP_DFU;
using namespace uploader;
class FlightStatus;
class UAVObject;
class OPLinkStatus;
class OPLinkWatchdog;
class TimedDialog : public QProgressDialog {
Q_OBJECT
@ -140,9 +143,11 @@ signals:
private:
Ui_UploaderWidget *m_config;
DFUObject *dfu;
IAPStep currentStep;
bool resetOnly;
DFUObject *m_dfu;
IAPStep m_currentIAPStep;
bool m_resetOnly;
OPLinkWatchdog m_oplinkwatchdog;
bool m_autoUpdateClosing;
void clearLog();
QString getPortDevice(const QString &friendName);

View File

@ -1,6 +0,0 @@
[Paths]
Prefix = ..
Plugins = lib/qt5/plugins
Imports = lib/qt5/qml
Qml2Imports = lib/qt5/qml
Libraries = lib/qt5