forked from DavidEGrayson/minimu9-ahrs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminimu9-ahrs-calibrator.1
53 lines (51 loc) · 1.64 KB
/
minimu9-ahrs-calibrator.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
.TH MINIMU9-AHRS-CALIBRATOR 1
.SH NAME
minimu9-ahrs-calibrator - read raw IMU data on standard
input and output a linear magnetometer calibration file
for use with minimu9-ahrs
.SH SYNOPSIS
.B minimu9-ahrs-calibrator < raw_readings > ~/.minimu9-ahrs-cal
.SH DESCRIPTION
This is a Python 2 script that takes raw IMU readings on its standard
input and uses the readings to compute a linear calibation
of the magnetometer.
The IMU should be rotated through as many different orientations
while generating the input.
.P
The input format consists of lines where each line has the format:
.IP
\fBMX MY MZ [EXTRA INPUT]\fP
.P
where \fBMX MY MZ\fP are integers that represent the raw reading from
the magnetometor.
Extra input on the line after the magnetomer readings is ignored.
.P
When the input stream ends, the script makes a simple linear calibration by
finding the minimum and maximum values for each axis and outputting them on the
standard output.
.P
The output format is:
.IP
\fBMIN_X MAX_X MIN_Y MAX_Y MIN_Z MAX_Z\fP
.P
The scaling formulae to convert raw readings to scaled readings are:
.IP
.nf
scaled_x = (raw_x - min_x) / (max_x - min_x) * 2 - 1
scaled_y = (raw_y - min_y) / (max_y - min_y) * 2 - 1
scaled_z = (raw_z - min_z) / (max_z - min_z) * 2 - 1
.fi
.P
Therefore, if the raw X value is equal to MIN_X
(the first number in the calibration), then
the scaled X value would be -1.0.
.SH NOTES
This script is very simple. There are more advanced ways to calibrate
magnetometers that might give you better results.
.SH AUTHOR
.nf
David Grayson <[email protected]>
http://www.github.com/DavidEGrayson/
.fi
.SH SEE ALSO
minimu9-ahrs(1), minimu9-ahrs-calibrate(1)