* ekf2: Add FirstOrderLpf and InnovationLpf classes for innovation lowpass filtering
* ekf2: use InnovLpf filter class in preflight checks
* ekf2: move selection of yaw test limit for pre-flight check in function
* ekf2: Move pre-flight checks into separate function
* ekf2: use static constexpr insetead of inline for sq (square) function
* ekf2: Split pre-flight checks in separate functions
Also use the same check for all the innovations:
innov_lpf < test and innov < 2xtest
* ekf2: Add optical flow pre-flight check
* ekf2: Combine FirstOrderLpf and InnovationLpf in single class
* ekf2: check vel_pos_innov when ev_pos is active as well
* ekf2: transform InnovationLpf into a header only library and pass the
spike limit during the update call to avoid storing it here
* ekf2: Static and const cleanup
- set spike_lim constants as static constexpr, set innovation
- set checker helper functions as static
- rename the mix of heading and yaw as heading to avoid confusion
* ekf2: use ternary operator in selectHeadingTestLimit instead of if-else
* ekf2: store intermediate redults in const bool flags. Those will be used for logging
* ekf2: set variable const whenever possible
* ekf2: create PreFlightChecker class that handle all the innovation
pre-flight checks.
Add simple unit testing
Use bitmask instead of general flag to have more granularity
* PreFlightChecker: use setter for the innovations to check instead of sending booleans in the update function
This makes it more scalable as more checks will be added
* ekf: Use booleans instead of bitmask for ekf preflt checks
Rename "down" to "vert"
Some of these perf counters were useful during initial development, but realistically aren't needed anymore, some are redundant when we can now see the average interval from `work_queue status` and some of them simply aren't worth the cost at higher rates.
Required for pwm_out_sim: only publish actuator_outputs when we get
actuator_controls. Otherwise lockstep startup does not work.
The issue was there before but hidden, due to a long poll timeout.
Works with HIL too.
Checking the first output_limited for a disarmed value is fragile.
For example a disarmed value might be within the range of min/max output
values and could then be triggered while armed.
This adds a flight task to catch the case where we want to do an
emergency descent without GPS but only a baro.
Previously, this would lead to the navigator land class being called
without position estimates which then made the flight tasks fail and
react with a flight task failsafe. This however meant that landed was
never detected and a couple of confusing error messages.
This applies if NAV_RCL_ACT is set to 3 "land".
* rename parameters to allow more descriptive names under CP group
* add option to enable moving where there is no data
* add test for param CP_GO_NO_DATA
Co-Authored-By: Martina Rivizzigno <martina@rivizzigno.it>
This could happen in the following cases:
- IRQ/publisher rate is faster than the processing rate, and therefore
WorkQueue::Add is called at a higher rate
- a long-running or stuck task that blocks the work queue a long time
Both cases are not expected to happen under 'normal' circumstances (if the
system runs as expected).