Tailsitter VTOLs very occasionally gets stuck with zero roll and pitch angle in multicopter mode after
a forward transition command is issued.
This very rare behavior is triggered by the following events:
1> a forward transition is triggered either in auto or manual mode.
2> in the vtol_att_control main loop, if multicopter and fixed wing attitude setpoints are not updated, transition state is not updated
3> the commander changes the vehicle status to transition mode.
4> multicopter pos controller initiated Transition flight task. This results in zero roll and pitch setpoint due to zero acceleration setpoint
5> now vtol_att_control executes and updates the transition state. Specifically, _q_trans_start and _q_trans_sp are set with zero roll and pitch sp
6> tilt is evaluated to be NaN, despite _q_trans_sp being normalized. This happens for 25% of all yaw angles when using float datatype. This can be
verified using the matrix library
7> once tilt is evaluated to be NaN, _q_trans_sp is never updated again and is stuck in this state for ever.
This has been fixed by constraining the cos(tilt) within +1 to -1 range
Further, _q_trans_start and _q_trans_sp are immedietly initialized after a transition event is triggered.
This changes the default mavlink message set from onboard to
onboard_low_bandwidth, which drastically reduces the bandwidth required to get a
usable connection.
- this is to help more users get the benefit (by default) and perhaps circumvent the common mistake of setting EKF2_HGT_MODE to range sensor
- this should be safe to enable as the range aid defaults are fairly conservative (max horizontal velocity 1 m/s, and range aid gate 1 SD)
statfs accesses the file-system and can be blocking for an extended period. Since the SD card check is part of the preflight checks in the main thread of commander, it could block its execution and cause various issues. The SD card is only mounted in rcS during boot so the state will not change after the first check.