- move vehicle at reset detection ekf2 -> land_detector
- ekf_unit: reduce init period
- Fake fusion is when at rest is quite strong and makes the variance reduce rapidly. Reduce the amount of time we wait before checking if the variances are still large enough.
- ekf_unit: reduce minimum vel/pos variance required after init
- Fake pos fusion has a low observation noise, making the vel/pos variances reduce quickly.
Co-authored-by:: bresch <brescianimathieu@gmail.com>
The both results of ?: should be of same type, and some compilers give error
on this:
" implicit conversion from 'float' to 'double' to match other result of conditional"
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
The tree stages used arbitrary 350, 250 300ms totally 900ms
So this changes it to each stage to a third of the parameter.
Default it is 1 second -> 333ms per stage.
- if distance to the ground is available then hysteresis times will be increased
by a factor of 3 if vehicle is higher than 1m above ground
Signed-off-by: RomanBapst <bapstroman@gmail.com>
- if "landed" and "maybe_landed" states are false then both the "hit_ground" and the "low_thrust" condition need to be true in order to detect landing
- ground contact MC NAN setpoint workaround
- ground contact additionally check acceleration setpoint
- schedule with vehicle_local_position updates (most updates require valid local position)
- don't allow LNDMC_Z_VEL_MAX to exceed MPC_LAND_SPEED
- ground contact horizontal movement checks default to failed if estimates aren't available
Consolidate _update_params() methods for improved inheritance from the LandDetector base class.
Move common uORB::Subscriptions to the base class for inheritance.
Deprecate redundant override methods.
* adds a work_queue systemcmd that will bring a tree view of all active work queues and work items
* WorkQueues now track attached WorkItems and will shutdown when the last WorkItem is detached
After landing it can happen that a second take off is detected and then the _takeoff_time is rest, resulting in a wrong total flight time counter. With this fix the flight time is reliably counted from the first take off until the vehicle is disarmed. Normally the vehicle will not spend much time armed after landing, if it does the flight time will be off but this is the same as before this fix. This fix was tested in several flight experiments.
Before that, different modules (ekf2, commander & land detector) changed
params upon different events:
- ekf2 & commander set params after disarm
- land detector set params on land detected
If the 2 events were several 100ms appart, it led to 2 param saves, and
the latter param set could have been blocked by an ongoing save. And if
the land detector was blocked, it could lead to mag timeouts.
This patch makes all modules use the same event, thus only a single param
save will happen.
If we want to have guarantees to never block, we should introduce a
param_try_set() API method.
The problem was signed vs unsigned mixing together with 64bit conversion:
int32_t flight_time = ...;
uint64_t _total_flight_time = ...;
_total_flight_time |= flight_time;
When flight_time is negative, the last line would first extend the sign
bit to the upper 32bits of the 64bit uint and then apply the bitwise OR.
The fix is to use an unsigned 32 bit value.