Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ models into sensor streams.

# Install

See the [installation tutorial](https://ignitionrobotics.org/api/sensors/4.0/installation.html).
See the [installation tutorial](https://ignitionrobotics.org/api/sensors/5.0/installation.html).

# Usage

Expand Down
30 changes: 27 additions & 3 deletions examples/imu_noise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,48 @@ To evaluate noise, first build and run.
mkdir build
cd build
cmake ..
```

### Ubuntu Or MacOS

```bash
make
```

This will generate the `sensor_noise` executable under `build`.

### Windows

```bash
cmake --build . --config Release
```

This will generate the `sensor_noise.exe` executable under `build\Release`.

```
# Ubuntu or MacOS
./sensor_noise

# Windows
.\Release\sensor_noise.exe
```

This will generate two series of samples, one for accelerometer and another for gyroscope.

To use the analysis script, first install Allan Tools:

```
pip install --user allantools
pip install --user allantools scipy
```

Then execute the script:

```
# Ubuntu o MacOS
../plot_samples.py

# Windows
python.exe ..\plot_samples.py
```

This will produce two graphs: the Allan Deviation plots for both the simulated accelerometer and gyroscope. The values on these graphs should correspond closely to the inputs:
Expand All @@ -39,11 +65,9 @@ This will produce two graphs: the Allan Deviation plots for both the simulated a
* sigma_N: Accelerometer Noise Density
* sigma_K: Accelerometer Random Walk


While this technique is used here to validate the operation of the algorithm, it could also be used
to estimate the noise parameters for a real IMU.


## References:

* Python Allan Tools: https://github.com/aewallin/allantools
Expand Down
8 changes: 4 additions & 4 deletions examples/imu_noise/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@

static constexpr double kSampleFrequency = 100.0;
// 16-bit ADC
static constexpr double kSamplePrecision = 1.0/pow(2.0, 16.0);
static double kSamplePrecision = 1.0/pow(2.0, 16.0);
// Generate 6 hours of data.
static constexpr double kNumSamples = 6 * 3600 * kSampleFrequency;

// Default values for use with ADIS16448 IMU
// These values come from the Rotors default values:
// https://github.com/ethz-asl/rotors_simulator/blob/513bb92da0c1a0c968bdc679dffc8fe7d77de918/rotors_gazebo_plugins/include/rotors_gazebo_plugins/gazebo_imu_plugin.h#L40
static constexpr double kDefaultAdisGyroscopeNoiseDensity =
2.0 * 35.0 / 3600.0 / 180.0 * M_PI;
2.0 * 35.0 / 3600.0 / 180.0 * IGN_PI;
static constexpr double kDefaultAdisGyroscopeRandomWalk =
2.0 * 4.0 / 3600.0 / 180.0 * M_PI;
2.0 * 4.0 / 3600.0 / 180.0 * IGN_PI;
static constexpr double kDefaultAdisGyroscopeBiasCorrelationTime =
1.0e+3;
static constexpr double kDefaultAdisGyroscopeTurnOnBiasSigma =
0.5 / 180.0 * M_PI;
0.5 / 180.0 * IGN_PI;
static constexpr double kDefaultAdisAccelerometerNoiseDensity =
2.0 * 2.0e-3;
static constexpr double kDefaultAdisAccelerometerRandomWalk =
Expand Down