Skip to content

Commit

Permalink
Improved Windows instructions (#116)
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <[email protected]>
  • Loading branch information
ahcorde authored Mar 30, 2021
1 parent 29e4c49 commit 8605a3a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
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

0 comments on commit 8605a3a

Please sign in to comment.