-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsensor_mock.py
More file actions
29 lines (24 loc) · 860 Bytes
/
sensor_mock.py
File metadata and controls
29 lines (24 loc) · 860 Bytes
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
import numpy as np
class SensorMock:
def __init__(self, sensor_type):
if sensor_type == 'IMU':
x_value = 1.0
y_value = 0.0
z_value = 1.0
self.sensor_read = {'measurements':
[
{'value':
(x_value, y_value, z_value)
}
]
}
if sensor_type == 'Tachometer':
value = 0.1
self.sensor_read = {'measurements':
[
{'value': value
}
]
}
def get_value(self):
return self.sensor_read