-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccellerometer.cpp
More file actions
50 lines (40 loc) · 1.07 KB
/
Copy pathAccellerometer.cpp
File metadata and controls
50 lines (40 loc) · 1.07 KB
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
#include "Accellerometer.h"
Accellerometer::Accellerometer(const std::string &n, const std::string &m, const std::string &d,const std::vector<double>& mis, const double& p, const double& v) : MovSens(p, v), Sensor(n,m,d,mis),
velocity(0){}
double Accellerometer::getVelocity() const
{
return velocity;
}
void Accellerometer::setVelocity(const double& vel)
{
velocity = vel;
}
void Accellerometer::setName(const std::string &nam)
{
name = nam;
}
void Accellerometer::setModel(const std::string &mod)
{
model = mod;
}
std::string Accellerometer::getName() const
{
return name;
}
std::string Accellerometer::getModel() const
{
return model;
}
void Accellerometer::addMisuration(const std::function<double (double, double)> &clamp)
{
double misuration = std::abs(velocity - ((getPosition2() - getPosition1())/getVariation())) / getVariation();
misurations.push_back(clamp(misuration, 5));
}
std::string Accellerometer::getDescription() const
{
return description;
}
void Accellerometer::setDescription(const std::string &d)
{
description = d;
}