-
Notifications
You must be signed in to change notification settings - Fork 1
/
device.hpp
54 lines (43 loc) · 1.57 KB
/
device.hpp
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
54
//===============================================================================//
// Name : device.hpp
// Author(s) : Barbara Bruno
// Affiliation : University of Genova, Italy - dept. DIBRIS
// Version : 1.0
// Description : Inertial device driver (virtual base class)
//===============================================================================//
#include <fstream>
#include <string>
#include "utils.hpp"
using namespace std;
#ifndef DEVICE_HPP_
#define DEVICE_HPP_
//! base class "Device" for the drivers of the inertial devices
class Device
{
public:
string name; //!< name of the device
//! constructor
//! @param[in] n name of the device
Device(string n)
{
name = n;
//DEBUG:cout<<"Device: " <<name <<endl;
}
//! print device information
void printInfo()
{
cout<<"Device: " <<name <<endl;
}
//! extract actual acceleration values from an offline sample
//! @param[in] &line one line transmitted by the device
//! @return matrix with the tri-axial acceleration values in m/s^2
virtual mat extractActual(string &line) = 0;
//! fill actual acceleration values from an online sample
//! @param[in] &ax x acceleration value
//! @param[in] &ay y acceleration value
//! @param[in] &az z acceleration value
//! @return matrix with the tri-axial acceleration values in m/s^2
// Function added by Enrique Coronado.
virtual mat fillActual(float ax, float ay, float az) = 0;
};
#endif