Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kalibr IMU Noise Model units problem? #354

Closed
maximpavliv opened this issue Mar 16, 2020 · 2 comments
Closed

Kalibr IMU Noise Model units problem? #354

maximpavliv opened this issue Mar 16, 2020 · 2 comments
Labels
question Theory or implementation question

Comments

@maximpavliv
Copy link

maximpavliv commented Mar 16, 2020

I am using your wonderful tool to calibrate my eye-tracking device.

I am intrigued by the IMU noise model as described here : You describe how to find the std of the noise and the random walk using the Allan standard deviation plot.
If I understand it correctly, the Allan plot would give the continuous std and random walk of the noise, in [(rad/s)*sqrt(s)] for the angular velocity and in [(m/s2)*sqrt(s)] for the accelerations. You also give the formulas to convert it to discrete std noise and random walk values, which I would expect to have the same units as the original units of the measurements ([m/s^2] or [rad/s]). The formula you give for the std of the noise (sigma{d} = sigma{c} / sqrt(dt)) does give [m/s^2] for the acceleration and [rad/s] for the angular velocities, but the formula for the random walk discretisation (sigma{d} = sigma{c} * sqrt(dt)) would give [m/s] as a unit for the acceleration random walk and [rad] as a unit for the angular velocity random walk. Are these the real units of discretized random walks, or is the random walk discretization formula not correct?

@ToniRV
Copy link

ToniRV commented Jul 10, 2020

I second this issue.

According to http://mars.cs.umn.edu/tr/reports/Trawny05b.pdf
I think the units should be:
image

Maybe someone more familiar with Kalibr way of doing things can verify this.

@mintar
Copy link
Contributor

mintar commented Nov 26, 2021

@maximpavliv wrote:

I am intrigued by the IMU noise model as described here: You describe how to find the std of the noise and the random walk using the Allan standard deviation plot. If I understand it correctly, the Allan plot would give the continuous std and random walk of the noise, in [(rad/s)*sqrt(s)] for the angular velocity and in [(m/s^2)*sqrt(s)] for the accelerations.

The Allan plot gives the same units as the ones listed on the Kalibr wiki page that you linked to:

  • "white noise" (= "angle random walk"/"velocity random walk"/"noise density"): [(rad/s) * (1/√Hz)] for gyros / [(m/s²) * (1/√Hz)] for accelerometers, which is equivalent to the units you used ([(rad/s)*sqrt(s)] for the angular velocity and in [(m/s^2)*sqrt(s)] for the accelerations).
  • "random walk" (= "rate random walk"/"acceleration random walk"/"random walk"): [(rad/s²) * (1/√Hz)] for gyros / [(m/s³) * (1/√Hz)] for accelerometers

You also give the formulas to convert it to discrete std noise and random walk values, which I would expect to have the same units as the original units of the measurements ([m/s^2] or [rad/s]). The formula you give for the std of the noise (sigma{d} = sigma{c} / sqrt(dt)) does give [m/s^2] for the acceleration and [rad/s] for the angular velocities,

Everything correct so far.

but the formula for the random walk discretisation (sigma{d} = sigma{c} * sqrt(dt)) would give [m/s] as a unit for the acceleration random walk and [rad] as a unit for the angular velocity random walk.

No, because as I wrote above (and as the table in the wiki page shows) the "random walk" parameter has a different unit, so the formula from the wiki page gives [(rad/s²) * (1/√Hz) * √s = (rad/s²) * √s * √s = rad/s] for gyros and [(m/s³) * (1/√Hz) * √s = (m/s³) * √s * √s = m/s²] for accelerometers.

By the way, here's a small python implementation of the formulas on the wiki page that will simulate IMU measurements based on the continuous noise_density and random_walk parameters:

import numpy as np

# n: number of measurements
# dt: sampling rate [s], e.g. dt = 1e-2 when sampling at 100 Hz
def generate_signal(n, dt, noise_density, random_walk, random_state=0):
    rng = np.random.RandomState(random_state)
    white = noise_density / np.sqrt(dt) * rng.randn(n)
    walk = random_walk * np.sqrt(dt) * np.cumsum(rng.randn(n))
    return white + walk

@ToniRV:

First off thanks for the link to the Trawny paper, that was very helpful.

The units that you propose are equivalent to the ones in the table on the Kalibr wiki page:

  • your "white noise" units already match
  • for the "random walk" units: rad/s * √Hz = rad/s * √Hz * √Hz/√Hz = rad/s * Hz * (1/√Hz) = rad/s * (1/s) * (1/√Hz) = (rad/s²) * (1/√Hz), and analogously for the accelerometer.

Your units look a bit nicer (because it immediately makes it clear that you have to multiply/divide by frequency, or equivalently divide/multiply by sampling rate), but they are equivalent.

TL;DR: In summary, the Kalibr wiki page is correct (although it took me a very long time to verify this, because it was inconsistent with lots of other software packages, but it turned out that those were incorrect). I think this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Theory or implementation question
Projects
None yet
Development

No branches or pull requests

4 participants