-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata_types.py
116 lines (103 loc) · 2.78 KB
/
data_types.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import enum
class OperatingMode(enum.Enum):
"""Operating modes of the robot."""
IDLE = 0
STAND_UP = 1
RUN = 2
SIT_DOWN = 3
"""Observations of the robot."""
observation_dtype = [
('roll', 'f4'),
('pitch', 'f4'),
('roll_vel', 'f4'),
('pitch_vel', 'f4'),
('leg_1_r_pos', 'f4'),
('wheel_r_pos', 'f4'),
('leg_1_l_pos', 'f4'),
('wheel_l_pos', 'f4'),
('leg_1_r_vel', 'f4'),
('wheel_r_vel', 'f4'),
('leg_1_l_vel', 'f4'),
('wheel_l_vel', 'f4'),
('leg_1_r_effort', 'f4'),
('wheel_r_effort', 'f4'),
('leg_1_l_effort', 'f4'),
('wheel_l_effort', 'f4'),
]
"""State of the robot."""
state_dtype = [
# State variables directly observed by the robot.
('roll', 'f4'),
('pitch', 'f4'),
('roll_vel', 'f4'),
('pitch_vel', 'f4'),
('leg_1_r_pos', 'f4'),
('wheel_r_pos', 'f4'),
('leg_1_l_pos', 'f4'),
('wheel_l_pos', 'f4'),
('leg_1_r_vel', 'f4'),
('wheel_r_vel', 'f4'),
('leg_1_l_vel', 'f4'),
('wheel_l_vel', 'f4'),
('leg_1_r_effort', 'f4'),
('wheel_r_effort', 'f4'),
('leg_1_l_effort', 'f4'),
('wheel_l_effort', 'f4'),
# State variables estimated by the robot.
('com_x', 'f4'),
('com_z', 'f4'),
('odometry_x', 'f4'),
('odometry_yaw', 'f4'),
('odometry_x_vel', 'f4'),
('odometry_yaw_vel', 'f4'),
('ground_contact_r', 'b1'),
('ground_contact_l', 'b1'),
]
"""Actions given to the hardware interface."""
action_dtype = [
('desired_leg_1_r_pos', 'f4'),
('desired_wheel_r_pos', 'f4'),
('desired_leg_1_l_pos', 'f4'),
('desired_wheel_l_pos', 'f4'),
('desired_leg_1_r_vel', 'f4'),
('desired_wheel_r_vel', 'f4'),
('desired_leg_1_l_vel', 'f4'),
('desired_wheel_l_vel', 'f4'),
('desired_leg_1_r_effort', 'f4'),
('desired_wheel_r_effort', 'f4'),
('desired_leg_1_l_effort', 'f4'),
('desired_wheel_l_effort', 'f4'),
('desired_leg_1_r_kp', 'f4'),
('desired_wheel_r_kp', 'f4'),
('desired_leg_1_l_kp', 'f4'),
('desired_wheel_l_kp', 'f4'),
('desired_leg_1_r_kd', 'f4'),
('desired_wheel_r_kd', 'f4'),
('desired_leg_1_l_kd', 'f4'),
('desired_wheel_l_kd', 'f4'),
]
"""User input to the robot."""
user_input_dtype = [
('start_toggle', 'b1'),
('stand_up_toggle', 'b1'),
('x', 'f4'),
('yaw', 'f4'),
]
"""Commands given to the controller."""
command_dtype = [
('odometry_x', 'f4'),
('odometry_yaw', 'f4'),
('odometry_x_vel', 'f4'),
('odometry_yaw_vel', 'f4'),
('leg_length_r', 'f4'),
('leg_length_l', 'f4'),
]
"""Command timestamps used to construct a trajectory."""
command_timestamps_dtype = [
('odometry_x', 'f4'),
('odometry_yaw', 'f4'),
('odometry_x_vel', 'f4'),
('odometry_yaw_vel', 'f4'),
('leg_length_r', 'f4'),
('leg_length_l', 'f4'),
]