Skip to content

Commit 8605a3a

Browse files
authored
Improved Windows instructions (#116)
Signed-off-by: ahcorde <[email protected]>
1 parent 29e4c49 commit 8605a3a

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

examples/imu_noise/README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,48 @@ To evaluate noise, first build and run.
1212
mkdir build
1313
cd build
1414
cmake ..
15+
```
16+
17+
### Ubuntu Or MacOS
18+
19+
```bash
1520
make
21+
```
22+
23+
This will generate the `sensor_noise` executable under `build`.
24+
25+
### Windows
26+
27+
```bash
28+
cmake --build . --config Release
29+
```
30+
31+
This will generate the `sensor_noise.exe` executable under `build\Release`.
32+
33+
```
34+
# Ubuntu or MacOS
1635
./sensor_noise
36+
37+
# Windows
38+
.\Release\sensor_noise.exe
1739
```
1840

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

2143
To use the analysis script, first install Allan Tools:
2244

2345
```
24-
pip install --user allantools
46+
pip install --user allantools scipy
2547
```
2648

2749
Then execute the script:
2850

2951
```
52+
# Ubuntu o MacOS
3053
../plot_samples.py
54+
55+
# Windows
56+
python.exe ..\plot_samples.py
3157
```
3258

3359
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:
@@ -39,11 +65,9 @@ This will produce two graphs: the Allan Deviation plots for both the simulated a
3965
* sigma_N: Accelerometer Noise Density
4066
* sigma_K: Accelerometer Random Walk
4167

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

46-
4771
## References:
4872

4973
* Python Allan Tools: https://github.com/aewallin/allantools

examples/imu_noise/main.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@
2626

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

3333
// Default values for use with ADIS16448 IMU
3434
// These values come from the Rotors default values:
3535
// https://github.com/ethz-asl/rotors_simulator/blob/513bb92da0c1a0c968bdc679dffc8fe7d77de918/rotors_gazebo_plugins/include/rotors_gazebo_plugins/gazebo_imu_plugin.h#L40
3636
static constexpr double kDefaultAdisGyroscopeNoiseDensity =
37-
2.0 * 35.0 / 3600.0 / 180.0 * M_PI;
37+
2.0 * 35.0 / 3600.0 / 180.0 * IGN_PI;
3838
static constexpr double kDefaultAdisGyroscopeRandomWalk =
39-
2.0 * 4.0 / 3600.0 / 180.0 * M_PI;
39+
2.0 * 4.0 / 3600.0 / 180.0 * IGN_PI;
4040
static constexpr double kDefaultAdisGyroscopeBiasCorrelationTime =
4141
1.0e+3;
4242
static constexpr double kDefaultAdisGyroscopeTurnOnBiasSigma =
43-
0.5 / 180.0 * M_PI;
43+
0.5 / 180.0 * IGN_PI;
4444
static constexpr double kDefaultAdisAccelerometerNoiseDensity =
4545
2.0 * 2.0e-3;
4646
static constexpr double kDefaultAdisAccelerometerRandomWalk =

0 commit comments

Comments
 (0)