-
Notifications
You must be signed in to change notification settings - Fork 8
/
accel_0.py
43 lines (37 loc) · 1003 Bytes
/
accel_0.py
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
import numpy as np
import pickle
import multiprocessing
import time
#------------------------------------------------
# TEST BY PUTTING DATA INTO ACCELEROMETER STREAMS
#-------------------------------------------------
def put_data_into_accelerometer_0(q):
pickled_data = pickle.dumps((
'acceleration_streams[0]',
np.array(
[
[1.0, 1.0, 1.0],
[1.0, 1.0, 1.0],
[2.0, 2.0, 2.0],
[2.0, 2.0, 2.0],
[2.0, 2.0, 2.0],
[3.0, 3.0, 3.0],
[101.0, 121.0, 201.0]
])))
q.put(pickled_data)
time.sleep(0.1)
pickled_data = pickle.dumps((
'acceleration_streams[0]',
np.array(
[
[0.0, 0.0, 0.0],
[1.0, 1.0, 1.0],
[0.0, 0.0, 0.0],
[2.0, 2.0, 2.0],
[0.0, 0.0, 0.0],
[3.0, 3.0, 3.0],
[80.0, 80.0, 80.0]
])))
q.put(pickled_data)
time.sleep(0.1)
return