* VTOL: take home_position into account for ground clearance
For approximating distance to ground in case there is no valid distance sensor
data, subtract the home position altitude from the local position altitude.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
Instead of always starting with instance 0 (potentially an internal
mag), first take the current sensor as reference to compare the other
ones against it.
The issue is that otherwise we can end up in a
situation where a switch occurs because the currently used sensor isn't
much better than a sensor with a lower index: because the selected one
isn't much better, we cannot "fail-over" to it and get stuck on another
sensor, triggering a fail-over.
- WelfordMeanVector now computes covariance
- use Kahan summation for Welford mean (but continue using float32 for actual mean, etc)
- WelfordMean and WelfordMeanVector handle initial value and count roll over
- Welford mean count rollover at 16 bit max to prevent numerical issues and shift weight to newer samples
- sensors/vehicle_imu: update Welford mean usage (now simplified with resets removed)
- fix vehicle_imu_status accel var, now properly rotated with full covariance matrix
- gyro_calibration: update Welford mean usage
This is fully backwards compatible: If the throttle trim is set to
the minimum then it's the legacy calibration and gets
interpreted such that there is no trim and behavior remains as before.
If the trim is set to a different value than the minimum then it gets
used like with all other channels which was unsupported before.
In review it was requested to have a different name for
manual_control_setpoint.z because of the adjusted range.
I started to investigate what naming is most intuitive and found
that most people recognize the stick axes as roll, pitch, yaw, throttle.
It comes at no surprise because other autopilots
and APIs seem to share this convention.
While changing the code I realized that even within the code base
the axes are usually assigned to a variable with that name or
have comments next to the assignment clarifying the axes
using these names.
To be consistent with all other axes of stick input and avoid future
rescaling confusion.
Note: for the MAVLink message 69 MANUAL_CONTROL it's using the full range
according to the message specs now [-1000,1000].
Add ARK_FMU_V6X to RCS netman
Remove arkv6x rc single wire
Fix arkv6x mtd
arkv6x bootloader init all pins to prevent power cycling peripherals on boot
arkv6x don't power cycle sd card on boot
arkv6x add UART4 Telem 4