11 Commits

Author SHA1 Message Date
Daniel Agar
967d35a6b6
rate limit most parameter_update subscriptions
- parameter updates can be quite expensive because they trigger nearly all modules to reload all of their parameters immediately
 - limit modules from updating faster than once per second
2021-01-10 21:09:15 -05:00
bresch
c253badba4 HTE: remove dist_bottom validity check
Without range finder, the validity flag goes to false quite quickly and
if can be that a vehicle never starts HTE is the takeoff is too slow.
In this specific context of takeoff detection, since
the exact value is not important, we can safely ignore the validity flag.
2020-12-18 12:05:22 +01:00
bresch
690c1158ad HTE: do not update the estimator during fast up/down motions
Drag and prop wash effects produce significant forces at high speed
that can bias the estimator when applied for an extended period of time
2020-12-18 12:05:22 +01:00
bresch
39251daf28 HTE: pull status from class instead of returning struct 2020-12-18 12:05:22 +01:00
bresch
652cc4350e HTE: empty braces initialization of struct 2020-12-18 12:05:22 +01:00
bresch
d532bc9555 HTE: only run in air
the _landed flag only is not enough to tell if the drone is still touching
the ground, so an additional check based on the altitude AGL is required.

to have this in_air detection correctly updated, the module needs to be
scheduled on the vehicle_local_position message as no setpoint is
produced in non-assisted modes.
2020-12-18 12:05:22 +01:00
Mathieu Bresciani
050c9dcd3d
HTE: fix variance prediction (#16016)
In the predition step, the process variance was erroneously
multiplied by dt instead of dt^2. The default values are adjusted
accordingly to keep the same tuning for the default loop rate of 50Hz
2020-10-27 16:56:32 +01:00
Daniel Agar
ba640acfcc
mc_hover_thrust_estimator: validity flag and other small improvements/fixes
- track and publish validity based on hover thrust variance, innovation test ratio, and hysteresis
 - only publish on actual updates or becoming inactive
 - fix dt (previous timestamp wasn't being saved)
 - use local position timestamp (corresponding) to accel data rather than current time to avoid unnecessary timing jitter
 - check local position validity before using
 - mc_hover_thrust_estimator: move from wq:lp_default -> wq:nav_and_controllers to ensure the hover thrust estimator runs after the position controller and uses the same vehicle_local_position data
 - land_detector: check hover thrust estimate validity and adjust low throttle thresholds if hover thrust is available
 - mc_pos_control: only use hover thrust estimate if valid
2020-08-03 10:30:52 -04:00
Matthias Grob
eb3b0f6b55 mathlib: get rid of now duplicate sign() function
Instead use the one that was copied to the matrix library in
https://github.com/PX4/Matrix/pull/116/
2020-03-17 10:01:42 +01:00
bresch
1bf791ba3f MC_HTE: Stability improvements
- Use a low-passed value of the signed innovation test ratio to trigger
the state variance boost. The threshold of 0.2 has been chosen using log
replay and simulation scenarii.
- Do not reset the learned accel noise during a state variance boost.
After a few tests, this does not seem to help at all.
- Continue to learn the accel noise even if the measurement got rejected
to avoid ignoring sudden changes of noise
- Lower the acceleration noise time constant and increase min/max
values to avoid learning quickly a small variance that could temporarly
destabilize the filter
- Update filter time constants. Increasing the speed of the residual lpf
improves the quality of the learned accel noise
2020-03-15 13:57:02 -04:00
Daniel Agar
f9794e99f8
move hover_thrust_estimator to new module (mc_hover_thrust_estimator)
* MC_HTE: unitialize with hover_thrust parameter
* MC_HTE: constrain hover thrust setter between 0.1 and 0.9
* MC_HTE: integrate with land detector and velocity controller
* MCHoverThrustEstimator: Always publish an estimate even when not fusing measurements. This is required as the land detector and the position controller need to receive a hover thrust value.

* MC_HTE: use altitude agl threshold to start the estimator
local_position.z is relative to the origin of the EKF while dist_bottom
is above ground

Co-authored-by: bresch <brescianimathieu@gmail.com>
2020-03-11 21:20:54 -04:00