Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kitlith
Copy link
Contributor

@kitlith kitlith commented Jan 5, 2025

Just ran into this: for some reason the native calibration tool for my sensor is doing a poor job of calibrating the gyro bias (or the sensor isn't taking the bias into account when producing quaternions?), so the default gyroClip value was causing the algorithm to never detect a rest. Setting the gyro bias via VQF::setBiasEstimate didn't help, which led me to the realization that the gyroClip doesn't take into account any known bias.

It personally makes more sense to me to make gyroClip relative to any already known bias than it does to raise gyroClip in this situation. Maybe there's a reason not to do this, though.

(aside: i don't have a good environment to test the python or matlab implementations right now, so you should probably make sure they still interpret/compile before accepting this PR.)

Prior to this commit, if the bias of a sensor exceeded the biasClip
parameter, it would be unable to detect rests, even if you gave VQF a
known estimate using VQF::setBiasEstimate or similar.
@kitlith
Copy link
Contributor Author

kitlith commented Jan 6, 2025

Hm. No, biasClip is used elsewhere in an absolute sense. This is either incomplete, or wrong.

@dlaidig
Copy link
Owner

dlaidig commented Feb 12, 2025

Sorry for the late reply. I somehow lost track of this. In the future, feel free to ping me after some time. :)

I think, in general, the change you suggested would be a valid design decision (as would be to just remove this additional condition and only consider restLastSquaredDeviations). Still, as you noticed, the limit of 2 °/s is used in various other places. Most importantly, it is also the limit for the actual bias estimation. As a result, the limit for rest detection would then be 4 °/s in some circumstances. Not sure if that is better or worse.

The rationale behind the absolute limit of 2 °/s for bias estimation was that

  1. most modern gyros should have a turn-on bias that is much lower than that, and
  2. if gyroscope bias estimation fails for some reason, I want to ensure that there is an upper bound on the damage this can do to the accuracy.

The reason to also include this threshold in the rest detection logic is to prevent some weird corner cases where the angular rate is surprisingly constant (i.e., some very smooth constant rotation like on a rotating table).

I think, generally, the best strategy would be to work on the calibration and ensure that the gyroscope bias that reaches VQF varies by less than 1 °/s. If this is not possible, I think modifying VQF locally is a good option.

Unfortunately, what I won't do is to modify the behavior of the VQF algorithm itself since this would invalidate the extensive validation done in the publication. For that reason, I will close the merge request for now, but I'm happy to discuss this further.

@dlaidig dlaidig closed this Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants