It turns out that ekf2 needs more stack when sideslip fusion fails.
Sideslip fusion is currently only enabled for fixedwing by default and
not executed in testing.
Unfortunately the constraints cannot be implemented using the
_constraints because the controller uses that directly. This
causes discontinuities in the velocity and/or accel at various
points of the flight. In particular this was used in Takeoff.
Instead this was done by changing target accel/velocity in the
jerk-optimal velocity planner for Z.
The modified statements are intended to
1. Set a new Z position setpoint that is equivalent to the current distance
to ground setpoint,
and
2. Set a new distance to ground setpoint that is equivalent to the current Z
position setpoint.
They are only called in terrain hold mode, when activating/deactivating the
holding (typically when coming to a stop and when starting to move again).
The setpoints take the current control error into account, but because the
control error is added, not subtracted, the result is that the new setpoint
is 2 times the control error off from the old setpoint, instead of being
at the same spot as the old setpoint.
Extend the get_freefall_state() from MC land detector to have a VTOL-specific
one that just enables free fall detection if in rotary wing or transition mode.
This is done to prevent wrong free-fall detected warnings while doing low-G maneuvers
(parabolic flights). Land detection is anyway disabled in FW flight for VTOL so
no logic change.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
The problem with printing the exception was that starting with
Python 3.6 the ImportError is yet another (sub) exception called
ModuleNotFoundError which can't be printed as a string and then triggers
another exception:
```
Traceback (most recent call last):
File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 11, in <module>
import jinja2
ModuleNotFoundError: No module named 'jinja2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 13, in <module>
print("Failed to import jinja2: " + e)
TypeError: must be str, not ModuleNotFoundError
```
As per @bkueng's suggestion the easiest is to cast the exception to str
and that way prevent the second exception.
- reduces amount of board configuration required
- removes the cyclic dependency between io_timers_t and timer_io_channels_t
Fixes a bug in the fmuk66-v3 config: the 2. timer has 3 channels associated
not 2.
Fixes a bug in the modelai config: the 2. timer has 4 channels associated.
Channels belonging to a certain timer were not all grouped together.
This is required by the .first_channel_index and .last_channel_index data
members.
We introduce a new mixer geometry to solve the problem.