forked from maxshep/Exoboot_Code
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsimulated_exoboots.py
More file actions
26 lines (23 loc) · 792 Bytes
/
simulated_exoboots.py
File metadata and controls
26 lines (23 loc) · 792 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
import exoboot
import config_util
import constants
import numpy as np
import ml_util
exo_list = []
for side in [constants.Side.LEFT, constants.Side.RIGHT]:
exo_list.append(exoboot.Exo(
dev_id=None, max_allowable_current=0))
exo_list[-1].side = side
for i in range(10):
for exo in exo_list:
exo.data.accel_x = np.random.rand()
exo.data.accel_y = np.random.rand()
exo.data.accel_z = np.random.rand()
exo.data.gyro_x = np.random.rand()
exo.data.gyro_y = np.random.rand()
exo.data.gyro_z = np.random.rand()
exo.data.ankle_angle = np.random.rand()
exo.data.ankle_velocity = np.random.rand()
message = ml_util.get_data_string_for_jetson(
side=exo.side, data=exo.data)
print(message)