1 | // gyrocalibrator.cc
|
---|
2 | // Eric Aubourg CEA/DAPNIA/SPP octobre 1999
|
---|
3 |
|
---|
4 | // assumption : same calibration for all gyros...
|
---|
5 |
|
---|
6 |
|
---|
7 | #include "gyrocalibrator.h"
|
---|
8 |
|
---|
9 | #define gyroCal "gyroCal"
|
---|
10 | #define gyroSpeed "gyroSpeed"
|
---|
11 |
|
---|
12 | GyroCalibrator::GyroCalibrator() {
|
---|
13 | possibleTOIs.insert(TOI(gyroCal, TOI::unspec, "linearCal", "deg/s/V"));
|
---|
14 | possibleTOIs.insert(TOI(gyroSpeed, TOI::all , "linearCal", "deg/s"));
|
---|
15 |
|
---|
16 | //needAfter = 3600; // about one turn...
|
---|
17 | startSample = -1;
|
---|
18 | lastFence1 = lastFence2 = -1;
|
---|
19 | }
|
---|
20 |
|
---|
21 | string GyroCalibrator::getName() {
|
---|
22 | return("GyroCalibrator 1.0");
|
---|
23 | }
|
---|
24 |
|
---|
25 |
|
---|
26 | set<TOI> GyroCalibrator::reqTOIFor(TOI const&) {
|
---|
27 | set<TOI> t;
|
---|
28 | t.insert(TOI("rotSpeed", TOI::unspec)); // pull only
|
---|
29 | t.insert(TOI("rotSpeedSample1", TOI::unspec)); // pull only
|
---|
30 | t.insert(TOI("rotSpeedSample2", TOI::unspec)); // pull only
|
---|
31 | t.insert(TOI("gyroV", 0)); // push
|
---|
32 | t.insert(TOI("gyroV", 1)); // push
|
---|
33 | t.insert(TOI("gyroV", 2)); // push
|
---|
34 | return t;
|
---|
35 | }
|
---|
36 |
|
---|
37 | void GyroCalibrator::dataFeed(TOIProducer* source, TOI const& toi, long sampleNum, double value) {
|
---|
38 | if (toi.name != "gyroV" || toi.index != 2) return;
|
---|
39 |
|
---|
40 | if (gyro2.empty()) {
|
---|
41 | startSample = sampleNum;
|
---|
42 | }
|
---|
43 |
|
---|
44 | gyro2.push_back(value);
|
---|
45 | }
|
---|
46 |
|
---|
47 |
|
---|
48 |
|
---|