diff --git a/src/AutoPilotPlugins/PX4/SafetyComponent.qml b/src/AutoPilotPlugins/PX4/SafetyComponent.qml index eb476426c6dde6a10d9bb233a339e1bf314e27b2..c519dff2fda4f10ba1ad17988a6d503155fa99c1 100644 --- a/src/AutoPilotPlugins/PX4/SafetyComponent.qml +++ b/src/AutoPilotPlugins/PX4/SafetyComponent.qml @@ -117,7 +117,7 @@ QGCView { QGCLabel { anchors.baseline: batLowLevelField.baseline width: _middleRowWidth - text: qsTr("Battery Low Level:") + text: qsTr("Battery Warn Level:") } FactTextField { id: batLowLevelField @@ -126,6 +126,19 @@ QGCView { width: _editFieldWidth } } + Row { + QGCLabel { + anchors.baseline: batLowLevelField.baseline + width: _middleRowWidth + text: qsTr("Battery Failsafe Level:") + } + FactTextField { + id: batCritLevelField + fact: controller.getParameterFact(-1, "BAT_CRIT_THR") + showUnits: true + width: _editFieldWidth + } + } } } } diff --git a/src/FactSystem/FactMetaData.cc b/src/FactSystem/FactMetaData.cc index 7a2089f60505f93c7f6a6f569a6c16d46d02e938..5fefc819e799a4892d37d64a9cdbae9c93d48083 100644 --- a/src/FactSystem/FactMetaData.cc +++ b/src/FactSystem/FactMetaData.cc @@ -38,6 +38,7 @@ const FactMetaData::BuiltInTranslation_s FactMetaData::_rgBuiltInTranslations[] = { { "centi-degrees", "degrees", FactMetaData::_centiDegreesToDegrees, FactMetaData::_degreesToCentiDegrees }, { "radians", "degrees", FactMetaData::_radiansToDegrees, FactMetaData::_degreesToRadians }, + { "norm", "%", FactMetaData::_normToPercent, FactMetaData::_percentToNorm }, }; // Translations driven by app settings @@ -449,6 +450,16 @@ QVariant FactMetaData::_knotsToMetersPerSecond(const QVariant& knots) return QVariant(knots.toDouble() * 0.51444444444); } +QVariant FactMetaData::_percentToNorm(const QVariant& percent) +{ + return QVariant(percent.toDouble() / 100.0); +} + +QVariant FactMetaData::_normToPercent(const QVariant& normalized) +{ + return QVariant(normalized.toDouble() * 100.0); +} + void FactMetaData::setRawUnits(const QString& rawUnits) { _rawUnits = rawUnits; diff --git a/src/FactSystem/FactMetaData.h b/src/FactSystem/FactMetaData.h index bfdcb3a924d0a4633116bfaeb1ef15481156d8c0..ed21cba003adce02dd2bd7aa212562ebc8546dc0 100644 --- a/src/FactSystem/FactMetaData.h +++ b/src/FactSystem/FactMetaData.h @@ -163,6 +163,8 @@ private: static QVariant _kilometersPerHourToMetersPerSecond(const QVariant& kilometersPerHour); static QVariant _metersPerSecondToKnots(const QVariant& metersPerSecond); static QVariant _knotsToMetersPerSecond(const QVariant& knots); + static QVariant _percentToNorm(const QVariant& percent); + static QVariant _normToPercent(const QVariant& normalized); struct AppSettingsTranslation_s { const char* rawUnits; diff --git a/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml b/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml index f626cd906837fcff0084c46b7c5277bb57b26cf8..3c7cdd42960838e2306de7f2d0ae304b0caa8087 100644 --- a/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml +++ b/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml @@ -2,7 +2,7 @@ 3 1 - 5 + 6 Speed controller bandwidth @@ -280,6 +280,7 @@ velocity Sets the threshold (between 0 and 1, which is equivalent to between 0 and 100%) when the battery will be reported as low. This has to be higher than the critical threshold. 0.15 0.5 + norm 2 0.01 @@ -288,6 +289,7 @@ velocity Sets the threshold (between 0 and 1, which is equivalent to between 0 and 100%) when the battery will be reported as critically low. This has to be lower than the low threshold. This threshold commonly will trigger RTL or landing. 0.05 0.14 + norm 2 0.01 @@ -449,7 +451,7 @@ velocity Datalink loss time threshold After this amount of seconds without datalink the data link lost mode triggers - 0 + 5 300 s 1 @@ -459,7 +461,7 @@ velocity Datalink regain time threshold After a data link loss: after this this amount of seconds with a healthy datalink the 'datalink loss' flag is set back to false 0 - 30 + 3 s 1 0.5 @@ -1268,6 +1270,7 @@ Assumes measurement is timestamped at trailing edge of integration periodThis is the throttle setting required to achieve the desired cruise speed. Most airframes have a value of 0.5-0.7. 0.0 1.0 + norm Throttle max slew rate @@ -1301,24 +1304,28 @@ Assumes measurement is timestamped at trailing edge of integration periodThis is the maximum throttle % that can be used by the controller. For overpowered aircraft, this should be reduced to a value that provides sufficient thrust to climb at the maximum pitch angle PTCH_MAX. 0.0 1.0 + norm Throttle limit min This is the minimum throttle % that can be used by the controller. For electric aircraft this will normally be set to zero, but can be set to a small non-zero value if a folding prop is fitted to prevent the prop from folding and unfolding repeatedly in-flight or to provide some aerodynamic drag from a turning prop to improve the descent rate. For aircraft with internal combustion engine this parameter should be set for desired idle rpm. 0.0 1.0 + norm Idle throttle This is the minimum throttle while on the ground For aircraft with internal combustion engine this parameter should be set above desired idle rpm. 0.0 0.4 + norm Throttle limit value before flare This throttle value will be set as throttle limit at FW_LND_TLALT, before arcraft will flare. 0.0 1.0 + norm Climbout Altitude difference @@ -1562,34 +1569,43 @@ Assumes measurement is timestamped at trailing edge of integration periodMulticopter max climb rate Maximum vertical velocity allowed in the landed state (m/s up and down) m/s + 1 Multicopter max horizontal velocity Maximum horizontal velocity allowed in the landed state (m/s) m/s + 1 Multicopter max rotation Maximum allowed angular velocity around each axis allowed in the landed state. deg/s + 1 Multicopter max throttle Maximum actuator output on throttle allowed in the landed state 0.1 0.5 + norm + 2 Multicopter specific force threshold Multicopter threshold on the specific force measured by accelerometers in m/s^2 for free-fall detection 0.1 10 + m/s^2 + 2 - + Multicopter free-fall trigger time Milliseconds that freefall conditions have to hold before triggering a freefall. Minimal value is limited by LAND_DETECTOR_UPDATE_RATE=50Hz in landDetector.h - 20 - 5000 + 0.02 + 5 + s + 2 Fixedwing max horizontal velocity @@ -1597,6 +1613,7 @@ Assumes measurement is timestamped at trailing edge of integration period0.5 10 m/s + 1 Fixedwing max climb rate @@ -1604,6 +1621,7 @@ Assumes measurement is timestamped at trailing edge of integration period5 20 m/s + 1 Fixedwing max short-term velocity @@ -1611,6 +1629,7 @@ Assumes measurement is timestamped at trailing edge of integration period2 10 m/s + 1 Airspeed max @@ -1618,6 +1637,7 @@ Assumes measurement is timestamped at trailing edge of integration period4 20 m/s + 1 @@ -1979,7 +1999,7 @@ Assumes measurement is timestamped at trailing edge of integration period Set data link loss failsafe mode - The data link loss failsafe will only be entered after a timeout, set by COM_RC_LOSS_T in seconds. Once the timeout occurs the selected action will be executed. Setting this parameter to 4 will enable CASA Outback Challenge rules, which are only recommended to participants of that competition. + The data link loss failsafe will only be entered after a timeout, set by COM_DL_LOSS_T in seconds. Once the timeout occurs the selected action will be executed. Setting this parameter to 4 will enable CASA Outback Challenge rules, which are only recommended to participants of that competition. Loiter Disabled @@ -2321,31 +2341,38 @@ Assumes measurement is timestamped at trailing edge of integration periodIt's recommended to set it > 0 to avoid free fall with zero thrust. 0.05 1.0 - 3 + norm + 2 Hover thrust Vertical thrust required to hover. This value is mapped to center stick for manual throttle control. With this value set to the thrust required to hover, transition from manual to ALTCTL mode while hovering will occur with the throttle stick near center, which is then interpreted as (near) zero demand for vertical speed. 0.2 0.8 + norm + 2 ALTCTL throttle curve breakpoint Halfwidth of deadband or reduced sensitivity center portion of curve. This is the halfwidth of the center region of the ALTCTL throttle curve. It extends from center-dz to center+dz. 0.0 0.2 + norm + 2 ALTCTL throttle curve breakpoint height Controls the slope of the reduced sensitivity region. This is the height of the ALTCTL throttle curve at center-dz and center+dz. 0.0 0.2 + 2 Maximum thrust in auto thrust control Limit max allowed thrust. Setting a value of one can put the system into actuator saturation as no spread between the motors is possible any more. A value of 0.8 - 0.9 is recommended. 0.0 0.95 + norm 2 @@ -2353,13 +2380,15 @@ Assumes measurement is timestamped at trailing edge of integration periodMinimum vertical thrust. It's recommended to set it > 0 to avoid free fall with zero thrust. 0.0 1.0 - 3 + norm + 2 Maximum manual thrust Limit max allowed thrust. Setting a value of one can put the system into actuator saturation as no spread between the motors is possible any more. A value of 0.8 - 0.9 is recommended. 0.0 1.0 + norm 2