-
Notifications
You must be signed in to change notification settings - Fork 0
/
REVConstants.py
231 lines (224 loc) · 4.21 KB
/
REVConstants.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#REVI2C constants
IMU_ADDRESS = 40
PAGE_ID = 7
CHIP_ID = 0
ACC_ID = 1
MAG_ID = 2
GYR_ID = 3
SW_REV_ID_LSB = 4
SW_REV_ID_MSB = 5
BL_REV_ID = 6
ACC_DATA_X_LSB = 8
ACC_DATA_X_MSB = 9
ACC_DATA_Y_LSB = 10
ACC_DATA_Y_MSB = 11
ACC_DATA_Z_LSB = 12
ACC_DATA_Z_MSB = 13
MAG_DATA_X_LSB = 14
MAG_DATA_X_MSB = 15
MAG_DATA_Y_LSB = 16
MAG_DATA_Y_MSB = 17
MAG_DATA_Z_LSB = 18
MAG_DATA_Z_MSB = 19
GYR_DATA_X_LSB = 20
GYR_DATA_X_MSB = 21
GYR_DATA_Y_LSB = 22
GYR_DATA_Y_MSB = 23
GYR_DATA_Z_LSB = 24
GYR_DATA_Z_MSB = 25
EUL_H_LSB = 26
EUL_H_MSB = 27
EUL_R_LSB = 28
EUL_R_MSB = 29
EUL_P_LSB = 30
EUL_P_MSB = 31
QUA_DATA_W_LSB = 32
QUA_DATA_W_MSB = 33
QUA_DATA_X_LSB = 34
QUA_DATA_X_MSB = 35
QUA_DATA_Y_LSB = 36
QUA_DATA_Y_MSB = 37
QUA_DATA_Z_LSB = 38
QUA_DATA_Z_MSB = 39
LIA_DATA_X_LSB = 40
LIA_DATA_X_MSB = 41
LIA_DATA_Y_LSB = 42
LIA_DATA_Y_MSB = 43
LIA_DATA_Z_LSB = 44
LIA_DATA_Z_MSB = 45
GRV_DATA_X_LSB = 46
GRV_DATA_X_MSB = 47
GRV_DATA_Y_LSB = 48
GRV_DATA_Y_MSB = 49
GRV_DATA_Z_LSB = 50
GRV_DATA_Z_MSB = 51
TEMP = 52
CALIB_STAT = 53
SELFTEST_RESULT = 54
INTR_STAT = 55
SYS_CLK_STAT = 56
SYS_STAT = 57
SYS_ERR = 58
UNIT_SEL = 59
DATA_SELECT = 60
OPR_MODE = 61
PWR_MODE = 62
SYS_TRIGGER = 63
TEMP_SOURCE = 64
CONFIGMODE = 0
ACCONLY = 1
MAGONLY = 2
GYROONLY = 3
ACCMAG = 4
ACCGYRO = 5
MAGGYRO = 6
AMG = 7
IMUMODE = 8
COMPASS = 9
M4G = 10
NDOF_FMC_OFF = 11
NDOF = 12
NORMAL = 0
LOW_POWER = 1
SUSPEND = 2
AXIS_MAP_CONFIG = 65
AXIS_MAP_SIGN = 66
SIC_MATRIX_0_LSB = 67
SIC_MATRIX_0_MSB = 68
SIC_MATRIX_1_LSB = 69
SIC_MATRIX_1_MSB = 70
SIC_MATRIX_2_LSB = 71
SIC_MATRIX_2_MSB = 72
SIC_MATRIX_3_LSB = 73
SIC_MATRIX_3_MSB = 74
SIC_MATRIX_4_LSB = 75
SIC_MATRIX_4_MSB = 76
SIC_MATRIX_5_LSB = 77
SIC_MATRIX_5_MSB = 78
SIC_MATRIX_6_LSB = 79
SIC_MATRIX_6_MSB = 80
SIC_MATRIX_7_LSB = 81
SIC_MATRIX_7_MSB = 82
SIC_MATRIX_8_LSB = 83
SIC_MATRIX_8_MSB = 84
ACC_OFFSET_X_LSB = 85
ACC_OFFSET_X_MSB = 86
ACC_OFFSET_Y_LSB = 87
ACC_OFFSET_Y_MSB = 88
ACC_OFFSET_Z_LSB = 89
ACC_OFFSET_Z_MSB = 90
MAG_OFFSET_X_LSB = 91
MAG_OFFSET_X_MSB = 92
MAG_OFFSET_Y_LSB = 93
MAG_OFFSET_Y_MSB = 94
MAG_OFFSET_Z_LSB = 95
MAG_OFFSET_Z_MSB = 96
GYR_OFFSET_X_LSB = 97
GYR_OFFSET_X_MSB = 98
GYR_OFFSET_Y_LSB = 99
GYR_OFFSET_Y_MSB = 100
GYR_OFFSET_Z_LSB = 101
GYR_OFFSET_Z_MSB = 102
ACC_RADIUS_LSB = 103
ACC_RADIUS_MSB = 104
MAG_RADIUS_LSB = 105
MAG_RADIUS_MSB = 106
EUL_UNIT_DEG = 0
EUL_UNIT_RAD = 4
GYR_UNIT_DPS = 0
GYR_UNIT_RPS = 2
ACC_UNIT_MSS = 0
ACC_UNIT_MG = 1
ACC_CONFIG = 8
MAG_CONFIG = 9
GYR_CONFIG_0 = 10
GYR_CONFIG_1 = 11
ACC_SLEEP_CONFIG = 12
GYR_SLEEP_CONFIG = 13
INT_MSK = 15
INT_EN = 16
ACC_AM_THRES = 17
ACC_INT_SETTINGS = 18
ACC_HG_DURATION = 19
ACC_HG_THRES = 20
ACC_NM_THRES = 21
ACC_NM_SET = 22
GRYO_INT_SETTING = 23
GRYO_HR_X_SET = 24
GRYO_DUR_ = 25
GRYO_HR_Y_SET = 26
GRYO_DUR_Y = 27
GRYO_HR_Z_SET = 28
GRYO_DUR_Z = 29
GRYO_AM_THRES = 30
GRYO_AM_SET = 31
UNIQUE_ID_FIRST = 80
UNIQUE_ID_LAST = 95
COMMAND_REGISTER_BIT = 128
SINGLE_BYTE_BIT = 0
MULTI_BYTE_BIT = 32
COLOR_SENSOR_ADDRESS = 57
COLOR_SENSOR_ID = 96
ENABLE_REGISTER = 0
ATIME_REGISTER = 1
WTIME_REGISTER = 3
AILTL_REGISTER = 4
AILTH_REGISTER = 5
AIHTL_REGISTER = 6
AIHTH_REGISTER = 7
PILTL_REGISTER = 8
PILTH_REGISTER = 9
PIHTL_REGISTER = 10
PIHTH_REGISTER = 11
PERS_REGISTER = 12
CONFIG_REGISTER = 13
PPULSE_REGISTER = 14
CONTROL_REGISTER = 15
REVISION_REGISTER = 17
ID_REGISTER = 18
STATUS_REGISTER = 19
CDATA_REGISTER = 20
CDATAH_REGISTER = 21
RDATA_REGISTER = 22
RDATAH_REGISTER = 23
GDATA_REGISTER = 24
GDATAH_REGISTER = 25
BDATA_REGISTER = 26
BDATAH_REGISTER = 27
PDATA_REGISTER = 28
PDATAH_REGISTER = 29
##REVADC constants
ADC_INPUT_CHANNEL_0 = 0
ADC_INPUT_CHANNEL_1 = 1
ADC_INPUT_CHANNEL_2 = 2
ADC_INPUT_CHANNEL_3 = 3
GPIO_CURRENT = 4
I2C_BUS_CURRENT = 5
SERVO_CURRENT = 6
BATTERY_CURRENT = 7
MOTOR_CHANNEL_0_CURRENT = 8
MOTOR_CHANNEL_1_CURRENT = 9
MOTOR_CHANNEL_2_CURRENT = 10
MOTOR_CHANNEL_3_CURRENT = 11
VOLTAGE_5V_MONITOR = 12
VOLTAGE_BATTERY_MONITOR = 13
CONTROLLER_TEMPERATURE = 14
#Color Sensor v3 constants
#REVMESSAGE constants
PAYLOAD_MAX_SIZE = 128
RESPONSE_BIT = 32768
#REVModule constants
VELOCITY_OFFSET = 6
ANALOG_OFFSET = 10
DIGITAL_OFFSET = 0
POSITION_OFFSET = 1
STATUS_OFFSET = 5
#REVMOTOR constants
Q16 = 65536.0
MODE_CONSTANT_POWER = 0
MODE_CONSTANT_VELOCITY = 1
MODE_POSITION_TARGET = 2
BRAKE_AT_ZERO = 0
FLOAT_AT_ZERO = 1
VELOCITY_OFFSET = 6
CURRENT_OFFSET = 8