mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 09:16:01 +03:00
Add setting nav_overrides_motor_stop_on_fs
This commit is contained in:
parent
cb1dd8d039
commit
7dc1f3f9d5
4 changed files with 10 additions and 3 deletions
|
@ -2111,6 +2111,11 @@ groups:
|
||||||
default_value: "ALL_NAV"
|
default_value: "ALL_NAV"
|
||||||
field: general.flags.nav_overrides_motor_stop
|
field: general.flags.nav_overrides_motor_stop
|
||||||
table: nav_overrides_motor_stop
|
table: nav_overrides_motor_stop
|
||||||
|
- name: nav_overrides_motor_stop_on_fs
|
||||||
|
description: "When OFF the motor status will never be overriden during FS. Meaning the motor will not start if FS is triggered while the throttle was low and nav_overrides_motor_stop = OFF"
|
||||||
|
default_value: "ON"
|
||||||
|
field: general.flags.nav_overrides_motor_stop_on_fs
|
||||||
|
type: bool
|
||||||
- name: nav_rth_climb_first
|
- name: nav_rth_climb_first
|
||||||
description: "If set to ON drone will climb to nav_rth_altitude first and head home afterwards. If set to OFF drone will head home instantly and climb on the way."
|
description: "If set to ON drone will climb to nav_rth_altitude first and head home afterwards. If set to OFF drone will head home instantly and climb on the way."
|
||||||
default_value: "ON"
|
default_value: "ON"
|
||||||
|
|
|
@ -586,7 +586,7 @@ motorStatus_e getMotorStatus(void)
|
||||||
const bool throttleStickLow =
|
const bool throttleStickLow =
|
||||||
(calculateThrottleStatus(feature(FEATURE_REVERSIBLE_MOTORS) ? THROTTLE_STATUS_TYPE_COMMAND : THROTTLE_STATUS_TYPE_RC) == THROTTLE_LOW);
|
(calculateThrottleStatus(feature(FEATURE_REVERSIBLE_MOTORS) ? THROTTLE_STATUS_TYPE_COMMAND : THROTTLE_STATUS_TYPE_RC) == THROTTLE_LOW);
|
||||||
|
|
||||||
if (throttleStickLow && fixedWingOrAirmodeNotActive && !failsafeIsActive()) {
|
if (throttleStickLow && fixedWingOrAirmodeNotActive && !(navConfig()->general.flags.nav_overrides_motor_stop_on_fs && failsafeIsActive())) {
|
||||||
// If user is holding stick low, we are not in failsafe and either on a plane or on a quad with inactive
|
// If user is holding stick low, we are not in failsafe and either on a plane or on a quad with inactive
|
||||||
// airmode - we need to check if we are allowing navigation to override MOTOR_STOP
|
// airmode - we need to check if we are allowing navigation to override MOTOR_STOP
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ STATIC_ASSERT(NAV_MAX_WAYPOINTS < 254, NAV_MAX_WAYPOINTS_exceeded_allowable_rang
|
||||||
PG_REGISTER_ARRAY(navWaypoint_t, NAV_MAX_WAYPOINTS, nonVolatileWaypointList, PG_WAYPOINT_MISSION_STORAGE, 0);
|
PG_REGISTER_ARRAY(navWaypoint_t, NAV_MAX_WAYPOINTS, nonVolatileWaypointList, PG_WAYPOINT_MISSION_STORAGE, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PG_REGISTER_WITH_RESET_TEMPLATE(navConfig_t, navConfig, PG_NAV_CONFIG, 8);
|
PG_REGISTER_WITH_RESET_TEMPLATE(navConfig_t, navConfig, PG_NAV_CONFIG, 9);
|
||||||
|
|
||||||
PG_RESET_TEMPLATE(navConfig_t, navConfig,
|
PG_RESET_TEMPLATE(navConfig_t, navConfig,
|
||||||
.general = {
|
.general = {
|
||||||
|
@ -107,6 +107,7 @@ PG_RESET_TEMPLATE(navConfig_t, navConfig,
|
||||||
.disarm_on_landing = 0,
|
.disarm_on_landing = 0,
|
||||||
.rth_allow_landing = NAV_RTH_ALLOW_LANDING_ALWAYS,
|
.rth_allow_landing = NAV_RTH_ALLOW_LANDING_ALWAYS,
|
||||||
.nav_overrides_motor_stop = NOMS_ALL_NAV,
|
.nav_overrides_motor_stop = NOMS_ALL_NAV,
|
||||||
|
.nav_overrides_motor_stop_on_fs = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
// General navigation parameters
|
// General navigation parameters
|
||||||
|
|
|
@ -181,7 +181,8 @@ typedef struct navConfig_s {
|
||||||
uint8_t disarm_on_landing; //
|
uint8_t disarm_on_landing; //
|
||||||
uint8_t rth_allow_landing; // Enable landing as last stage of RTH. Use constants in navRTHAllowLanding_e.
|
uint8_t rth_allow_landing; // Enable landing as last stage of RTH. Use constants in navRTHAllowLanding_e.
|
||||||
uint8_t rth_climb_ignore_emerg; // Option to ignore GPS loss on initial climb stage of RTH
|
uint8_t rth_climb_ignore_emerg; // Option to ignore GPS loss on initial climb stage of RTH
|
||||||
uint8_t nav_overrides_motor_stop; // Autonomous modes override motor_stop setting and user command to stop motor
|
uint8_t nav_overrides_motor_stop; // Autonomous modes override motor_stop setting and user command to stop motor
|
||||||
|
uint8_t nav_overrides_motor_stop_on_fs; // When false the motor status will never be overriden during FS. Meaning the motor will not start if FS is triggered while the throttle was low and nav_overrides_motor_stop = OFF
|
||||||
} flags;
|
} flags;
|
||||||
|
|
||||||
uint8_t pos_failure_timeout; // Time to wait before switching to emergency landing (0 - disable)
|
uint8_t pos_failure_timeout; // Time to wait before switching to emergency landing (0 - disable)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue