This removes the need for the pointer to the first flight mode, and
removes the undefined behavior resulting from indexing past that first
flight mode and hoping the others follow (though this is unlikely to
pose a problem in practice).
Saves a few bytes of RAM and flash as the pointer is no longer needed
and code is no longer necessary to set it up.
Introduces the RNGFND_LND_DIST parameter, which defines the horizontal
distance to the landing point at which the rangefinder engages when
RNGFND_LANDING is enabled. This is useful for landing on platforms or
small plateaus, and to avoid interference from uneven terrain or
obstacles during the approach.
When set to the default value of 0, the rangefinder engages as soon as
it is within range, matching existing behavior.
Key changes:
- Adds RNGFND_LND_DIST parameter to control rangefinder engagement
horizontal distance during landing.
- Updates rangefinder logic to engage only when within the specified
distance.
- Requires rangefinder_state.in_use for rangefinder correction to be
applied.
- Requires both in_use and in_range for rangefinder_active to be true.
Increase the storage width of throttle slew rate parameters from AP_Int8
to AP_Int16 to allow higher values.
Affected parameters:
- THR_SLEWRATE
- TKOFF_THR_SLEW
- Landing THR_SLEW
The parameter range is increased from 127 to 500 (%/s). This increases the
maximum allowed slew rate but does not change the parameter resolution.
Existing parameters are migrated using convert_parameter_width(AP_PARAM_INT8)
to preserve stored values.
Fixes#2024
Aerodynamic load factor-based roll demand limits were only applied down
to ±25º to keep the aircraft maneuverable with a bad airspeed estimate.
However, with the addition of the AIRSPEED_STALL parameter, this is
unsafe if the aircraft is actually flying very close to its stall speed,
and can result in a spin.
This commit adds a FLIGHT_OPTION to make it possible for the roll demand
limits to go all the way down to LEVEL_ROLL_LIMIT if an airspeed sensor
is fitted and in use and the AIRSPEED_STALL parameter is set, since
under these conditions, the airspeed estimate is accurate and there is
very little bank angle overhead to prevent a stall.
it needs to be a constant so that when the user changes TRIM_THROTTLE (eg. via DO_CHANGE_SPEED or via the parameter) that it doesn't change the tuning of their PID loops by changing the speed scaler. The aircraft could either start oscillating badly or could become very sluggish in control
Slope treatment for a flight leg was conditioned to a minimum height of
20m (which was a hardcoded value and only documented in a comment in the
code), below which an immediate altitude change was performed for that
leg. This caused unpredictable results for flight plans with waypoints
at exactly 20m followed by a climb, as the aircraft could, depending on
chance, be above or below the height demand, resulting in very different
trajectories.
This commit addresses that issue with the following changes:
- Added a parameter to control the minimum height at which a gradual
climb slope can be performed. This documents the original feature and
retains the safety aspect of it.
- Changed the behavior when below said minimum height to only
immediately climb up to the safe height, regaining the intended climb
slope afterwards. This leverages existing code for recalculating climb
slopes, provides a good balance between safety and following the
flight plan as intended, and fixes the core issue of different
trajectories being taken based on random external factors.
this gives greater control of when the rangefinder will be used. A
particularly important one is the ability to disable it for VTOL
assist as false positives can be quite common and drains the battery
this allows auto flaps in manual throttle modes, and when speed drops
in an uncommanded fashion
this needs to be used with caution and carefully tested on an aircraft
as it could result in an oscillation, as adding flaps can change the
airspeed
The current implementation of pitch stick mixing is unsafe, as it
introduces an attitude override that is decoupled from the TECS, and
also lacks any stall and overspeed prevention mechanisms. This means
that if a pitch nudge is held long enough, an overspeed or a stall will
occur.
This commit introduces a "FBW style (no pitch)" setting to the
STICK_MIXING parameter. It behaves like the current "FBWMixing" option
for roll and yaw, but doesn't provide any pitch mixing. A warning about
the lack of flight envelope protections in "FWB style" mode has also
been added to the description.
Smooth altitude changes were always referred to as "glide slopes"
despite this not being the appropriate aviation term in the case of a
climb. A better option is "altitude slope", which encompasses both
smooth climbs and descents.
Changed all references to glide slopes, except those that specifically
refer to a single kind (like those used for landings), to the more
general term. This also includes changing the GLIDE_SLOPE_MIN and
GLIDE_SLOPE_THR parameters to ALT_SLOPE_MIN and ALT_SLOPE_MAXHGT,
respectively.
Updated the forward throttle battery voltage compensation feature to
disable the throttle entirely when the sag-compensated voltage drops
below the new parameter FWD_THR_CUTOFF_V.
Key changes:
- Added new parameter FWD_THR_CUTOFF_V to control the voltage threshold
for this feature. The default value of 0 matches the original behavior
of never cutting the throttle due to low voltage.
- Modified forward throttle battery voltage compensation logic in the
servos code to cut off the throttle in auto-throttle modes if the
resting voltage estimate of the FWD_BAT_IDX battery is under
FWD_THR_CUTOFF_V.