[BUG] default madgwick gain when using magnetometer is only set if mag data is passed on init
ManuelPalermo opened this issue · comments
If "mag" data is not passed on init (mag=None) the gain is initialized with the default imu value and used when calling updateMARG
function:
Line 511 in 45af983
I propose adding two different gain params on init (gain_imu
and gain_ahrs
), one for each mode, solving this issue and also allowing the use of updateIMU
and updateMARG
functions on the same initialized filter (ex. using IMU when magnetic distortions are detected on a step and MARG otherwise).
Good idea. I'll add separate gains to deal with the updates independently.