iCub-main
imuMeasureConverter.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * Author Valentina Gaggero
6  *
7  * This software may be modified and distributed under the terms of the
8  * BSD-3-Clause license. See the accompanying LICENSE file for details.
9  */
10 
11 #include "imuMeasureConverter.h"
12 
13 // double accFactor; //raw to metric measure
14 // double gyrFactor; //raw to metric measure
15 // double magFactor; //raw to metric measure
16 
18 {
19  double accFactor = 1.0;
20  double gyrFactor = 1.0;
21  double magFactor = 1.0;
22  double eulFactor = 1.0;
23 }
24 
25 ImuMeasureConverter::ImuMeasureConverter(double accConvFactor, double gyrConvFactor, double magConvFactor, double eulConvFactor)
26 {
27  Initialize(accConvFactor, gyrConvFactor, magConvFactor, eulConvFactor);
28 }
29 
30 void ImuMeasureConverter::Initialize(double accConvFactor, double gyrConvFactor, double magConvFactor, double eulConvFactor)
31 {
32  accFactor = accConvFactor;
33  gyrFactor = gyrConvFactor;
34  magFactor = magConvFactor;
35  eulFactor = eulConvFactor;
36 }
37 
38 double ImuMeasureConverter::convertAcc_raw2metric(double accRaw) const
39 {
40  return accRaw / accFactor;
41 }
42 double ImuMeasureConverter::convertGyr_raw2metric(double gyrRaw) const
43 {
44  return gyrRaw / gyrFactor;
45 }
46 double ImuMeasureConverter::convertMag_raw2metric(double magRaw) const
47 {
48  return magRaw / magFactor;
49 }
50 
51 double ImuMeasureConverter::convertEul_raw2metric(double eulRaw) const
52 {
53  return eulRaw/eulFactor;
54 }
55 
double convertEul_raw2metric(double) const
double convertAcc_raw2metric(double) const
void Initialize(double accConvFactor, double gyrConvFactor, double magConvFactor, double eulConvFactor)
double convertMag_raw2metric(double) const
double convertGyr_raw2metric(double) const