data_sets.py
Go to the documentation of this file.
1 from enum import Enum, IntEnum
2 
3 # Everything in this file comes from data_sets.h.
4 # This file needs to be kept in sync with data_sets.h
5 
6 DID_NULL = 0
7 DID_DEV_INFO = 1
8 DID_SYS_FAULT = 2
9 DID_PREINTEGRATED_IMU = 3
10 DID_INS_1 = 4
11 DID_INS_2 = 5
12 DID_GPS1_UBX_POS = 6
13 DID_CONFIG = 7
14 DID_ASCII_BCAST_PERIOD = 8
15 DID_RMC = 9
16 DID_SYS_PARAMS = 10
17 DID_SYS_SENSORS = 11
18 DID_FLASH_CONFIG = 12
19 DID_GPS1_POS = 13
20 DID_GPS2_POS = 14
21 DID_GPS1_SAT = 15
22 DID_GPS2_SAT = 16
23 DID_GPS1_VERSION = 17
24 DID_GPS2_VERSION = 18
25 DID_MAG_CAL = 19
26 DID_INTERNAL_DIAGNOSTIC = 20
27 DID_GPS1_RTK_POS_REL = 21
28 DID_GPS1_RTK_POS_MISC = 22
29 DID_FEATURE_BITS = 23
30 DID_SENSORS_IS1 = 24
31 DID_SENSORS_IS2 = 25
32 DID_SENSORS_TC_BIAS = 26
33 DID_IO = 27
34 DID_SENSORS_ADC = 28
35 DID_SCOMP = 29
36 DID_GPS1_VEL = 30
37 DID_GPS2_VEL = 31
38 DID_HDW_PARAMS = 32
39 DID_NVR_MANAGE_USERPAGE = 33
40 DID_NVR_USERPAGE_SN = 34
41 DID_NVR_USERPAGE_G0 = 35
42 DID_NVR_USERPAGE_G1 = 36
43 DID_DEBUG_STRING = 37
44 DID_RTOS_INFO = 38
45 DID_DEBUG_ARRAY = 39
46 DID_SENSORS_CAL1 = 40
47 DID_SENSORS_CAL2 = 41
48 DID_CAL_SC = 42
49 DID_CAL_SC1 = 43
50 DID_CAL_SC2 = 44
51 DID_SYS_SENSORS_SIGMA = 45
52 DID_SENSORS_ADC_SIGMA = 46
53 DID_INS_DEV_1 = 47
54 DID_INL2_STATES = 48
55 DID_INL2_COVARIANCE_LD = 49
56 DID_INL2_STATUS = 50
57 DID_INL2_MISC = 51
58 DID_MAGNETOMETER_1 = 52
59 DID_BAROMETER = 53
60 DID_GPS1_RTK_POS = 54
61 DID_UNUSED_55 = 55
62 DID_COMMUNICATIONS_LOOPBACK = 56
63 DID_DUAL_IMU_RAW = 57
64 DID_DUAL_IMU = 58
65 DID_INL2_MAG_OBS_INFO = 59
66 DID_GPS_BASE_RAW = 60
67 DID_GPS_RTK_OPT = 61
68 DID_NVR_USERPAGE_INTERNAL = 62
69 DID_MANUFACTURING_INFO = 63
70 DID_BIT = 64
71 DID_INS_3 = 65
72 DID_INS_4 = 66
73 DID_INL2_VARIANCE = 67
74 DID_STROBE_IN_TIME = 68
75 DID_GPS1_RAW = 69
76 DID_GPS2_RAW = 70
77 DID_WHEEL_ENCODER = 71
78 DID_DIAGNOSTIC_MESSAGE = 72
79 DID_SURVEY_IN = 73
80 DID_EVB2 = 74
81 DID_PORT_MONITOR = 75
82 DID_RTK_STATE = 76
83 DID_RTK_PHASE_RESIDUAL = 77
84 DID_RTK_CODE_RESIDUAL = 78
85 DID_RTK_DEBUG = 79
86 DID_EVB_STATUS = 80
87 DID_EVB_CONFIG = 81
88 DID_EVB_DEBUG_ARRAY = 82
89 DID_EVB_RTOS_INFO = 83
90 DID_DUAL_IMU_RAW_MAG = 84
91 DID_DUAL_IMU_MAG = 85
92 DID_PREINTEGRATED_IMU_MAG = 86
93 DID_WHEEL_CONFIG = 87
94 DID_POSITION_MEASUREMENT = 88
95 DID_RTK_DEBUG_2 = 89
96 DID_CAN_CONFIG = 90
97 DID_GPS1_RTK_CMP_REL = 91
98 DID_GPS1_RTK_CMP_MISC = 92
99 
100 NUM_DIDS = 96
101 
102 
103 did_name_lookup = {
104  DID_NULL : "null",
105  DID_DEV_INFO : "devInfo",
106  DID_SYS_FAULT : "sysFault",
107  DID_PREINTEGRATED_IMU : "preintegratedImu",
108  DID_INS_1 : "ins1",
109  DID_INS_2 : "ins2",
110  DID_GPS1_UBX_POS : "gps1UbxPos",
111  DID_CONFIG : "config",
112  DID_ASCII_BCAST_PERIOD : "asciiBcastPeriod",
113  DID_RMC : "rmc",
114  DID_SYS_PARAMS : "sysParams",
115  DID_SYS_SENSORS : "sysSensors",
116  DID_FLASH_CONFIG : "flashConfig",
117  DID_GPS1_POS : "gps1Pos",
118  DID_GPS2_POS : "gps2Pos",
119  DID_GPS1_SAT : "gps1Sat",
120  DID_GPS2_SAT : "gps2Sat",
121  DID_GPS1_VERSION : "gps1Version",
122  DID_GPS2_VERSION : "gps2Version",
123  DID_MAG_CAL : "magCal",
124  DID_INTERNAL_DIAGNOSTIC : "internalDiagnostic",
125  DID_GPS1_RTK_POS_REL : "gps1RtkPosRel",
126  DID_GPS1_RTK_CMP_REL : "gps1RtkCmpRel",
127  DID_GPS1_RTK_POS_MISC: "gps1RtkPosMisc",
128  DID_GPS1_RTK_CMP_MISC: "gps1RtkCmpMisc",
129  DID_FEATURE_BITS : "featureBits",
130  DID_SENSORS_IS1 : "sensorsIs1",
131  DID_SENSORS_IS2 : "sensorsIs2",
132  DID_SENSORS_TC_BIAS : "sensorsTcBias",
133  DID_IO : "io",
134  DID_SENSORS_ADC : "sensorsAdc",
135  DID_SCOMP : "scomp",
136  DID_GPS1_VEL : "gps1Vel",
137  DID_GPS2_VEL : "gps2Vel",
138  DID_HDW_PARAMS : "hdwParams",
139  DID_NVR_MANAGE_USERPAGE : "nvrManageUserpage",
140  DID_NVR_USERPAGE_SN : "nvrUserpageSn",
141  DID_NVR_USERPAGE_G0 : "nvrUserpageG0",
142  DID_NVR_USERPAGE_G1 : "nvrUserpageG1",
143  DID_DEBUG_STRING : "debugString",
144  DID_RTOS_INFO : "rtosInfo",
145  DID_DEBUG_ARRAY : "debugArray",
146  DID_SENSORS_CAL1 : "sensorsCal1",
147  DID_SENSORS_CAL2 : "sensorsCal2",
148  DID_CAL_SC : "calSc",
149  DID_CAL_SC1 : "calSc1",
150  DID_CAL_SC2 : "calSc2",
151  DID_SYS_SENSORS_SIGMA : "sysSensorsSigma",
152  DID_SENSORS_ADC_SIGMA : "sensorsAdcSigma",
153  DID_INS_DEV_1 : "insDev1",
154  DID_INL2_STATES : "inl2States",
155  DID_INL2_COVARIANCE_LD : "inl2CovarianceLd",
156  DID_INL2_STATUS : "inl2Status",
157  DID_INL2_MISC : "inl2Misc",
158  DID_MAGNETOMETER_1 : "magnetometer1",
159  DID_BAROMETER : "barometer",
160  DID_GPS1_RTK_POS : "gps1RtkPos",
161  DID_COMMUNICATIONS_LOOPBACK : "communicationsLoopback",
162  DID_DUAL_IMU_RAW : "dualImuRaw",
163  DID_DUAL_IMU : "dualImu",
164  DID_INL2_MAG_OBS_INFO : "inl2MagObsInfo",
165  DID_GPS_BASE_RAW : "gpsBaseRaw",
166  DID_GPS_RTK_OPT : "gpsRtkOpt",
167  DID_NVR_USERPAGE_INTERNAL : "nvrUserpageInternal",
168  DID_MANUFACTURING_INFO : "manufacturingInfo",
169  DID_BIT : "bit",
170  DID_INS_3 : "ins3",
171  DID_INS_4 : "ins4",
172  DID_INL2_VARIANCE : "inl2Variance",
173  DID_STROBE_IN_TIME : "strobeInTime",
174  DID_GPS1_RAW : "gps1Raw",
175  DID_GPS2_RAW : "gps2Raw",
176  DID_WHEEL_ENCODER : "wheelEncoder",
177  DID_DIAGNOSTIC_MESSAGE : "diagnosticMessage",
178  DID_SURVEY_IN : "surveyIn",
179  DID_EVB2 : "evb2",
180  DID_PORT_MONITOR : "portMonitor",
181  DID_RTK_STATE : "rtkState",
182  DID_RTK_PHASE_RESIDUAL : "rtkPhaseResidual",
183  DID_RTK_CODE_RESIDUAL : "rtkCodeResidual",
184  DID_RTK_DEBUG : "rtkDebug",
185  DID_EVB_STATUS : "evbStatus",
186  DID_EVB_CONFIG : "evbConfig",
187  DID_EVB_DEBUG_ARRAY : "evbDebugArray",
188  DID_EVB_RTOS_INFO : "evbRtosInfo",
189  DID_RTK_DEBUG_2: "rtkDebug2",
190  DID_CAN_CONFIG: "canconfig",
191 }
192 
193 class eGpsNavFixStatus(Enum):
194  """ Navigation Fix Type """
195  NAV_FIX_STATUS_NONE = 0x00000000
196  NAV_FIX_STATUS_3D = 0x00000001
197  NAV_FIX_STATUS_RTK_FLOAT = 0x00000002
198  NAV_FIX_STATUS_RTK_FIX = 0x00000003
199 
200 
201 # This function is based on the INS_STATUS_NAV_FIX_STATUS macro in data_sets.h
202  @staticmethod
203  def from_ins_status(insStatus):
204  INS_STATUS_NAV_FIX_STATUS_MASK = 0x07000000
205  INS_STATUS_NAV_FIX_STATUS_OFFSET = 24
206  return eNavFixStatus((insStatus&INS_STATUS_NAV_FIX_STATUS_MASK)>>INS_STATUS_NAV_FIX_STATUS_OFFSET)
207 
208  def __str__(self):
209  return self.name
210 
211 
212 class eRtosTask(Enum):
213  """
214  RTOS task types
215  """
216  TASK_SAMPLE = 0 # Sample task
217  TASK_NAV = 1 # Nav task
218  TASK_COMMUNICATIONS = 2 # Communications task
219  TASK_MAINTENANCE = 3 # Maintenance task
220  TASK_IDLE = 4 # Idle task
221  TASK_TIMER = 5 # Timer task
222  RTOS_NUM_TASKS = 6 # Number of RTOS tasks - KEEP LAST
223 
224 class eRawDataType(Enum):
225  raw_data_type_observation = 1
226  raw_data_type_ephemeris = 2
227  raw_data_type_glonass_ephemeris = 3
228  raw_data_type_sbas = 4
229  raw_data_type_base_station_antenna_position = 5
230  raw_data_type_ionosphere_model_utc_alm = 6
231 
232 
233 # This is part of eInsStatusFlags from data_sets.h
234 class eInsStatusRtkBase(Enum):
235  """RTK base portion of INS status"""
236  INS_STATUS_RTK_BASE_ERR_NO_OBSERV = 0x08000000 # GPS base NO observations received (i.e. RTK differential corrections)
237  INS_STATUS_RTK_BASE_ERR_NO_POSITION = 0x10000000 # GPS base NO position received
238  INS_STATUS_RTK_BASE_POSITION_MOVING = 0x20000000 # GPS base position is moving
239 
240  @staticmethod
241  def from_ins_status(insStatus):
242  INS_STATUS_RTK_BASE_MASK = 0x38300000 # GPS base mask
243  status = insStatus & INS_STATUS_RTK_BASE_MASK
244  if status:
245  return eInsStatusRtkBase
246  return None
247 
248 
249 class SysFaultStatus(Enum):
250  # Normal Resets
251  HARDWARE_RESET = 0x00000000
252  USER_RESET = 0x00000001
253  ENABLE_BOOTLOADER = 0x00000002
254 
255  # General Errors
256  SOFT_RESET = 0x00000010
257  FLASH_MIGRATION_EVENT = 0x00000020
258  FLASH_MIGRATION_COMPLETED = 0x00000040
259 
260  # Critical Errors
261  HARD_FAULT = 0x00010000
262  USAGE_FAULT = 0x00020000
263  MEM_MANGE = 0x00040000
264  BUS_FAULT = 0x00080000
265  MALLOC_FAILED = 0x00100000
266  STACK_OVERFLOW = 0x00200000
267  INVALID_CODE_OPERATION = 0x00400000
268  FLASH_MIGRATION_MARKER_UPDATED = 0x00800000
269 
270  def is_general_error(self):
271  MASK_GENERAL_ERROR = 0xFFFFFFF0
272  return self.value & MASK_GENERAL_ERROR
273 
274  def is_critical_error(self):
275  MASK_CRITICAL_ERROR = 0xFFFF0000
276  return self.value & MASK_CRITICAL_ERROR
277 
278 
279 
280 class eConfigSystem(IntEnum):
281  CFG_SYS_CMD_SAVE_PERSISTENT_MESSAGES = 1
282  CFG_SYS_CMD_ENABLE_BOOTLOADER_AND_RESET = 2
283  CFG_SYS_CMD_ENABLE_SENSOR_STATS = 3
284  CFG_SYS_CMD_ENABLE_RTOS_STATS = 4
285  CFG_SYS_CMD_ENABLE_GPS_LOW_LEVEL_CONFIG = 10
286  CFG_SYS_CMD_CLEAR_GPS_ASSIST_FROM_FLASH = 97
287  CFG_SYS_CMD_SAVE_GPS_ASSIST_TO_FLASH_RESET = 98
288  CFG_SYS_CMD_SOFTWARE_RESET = 99


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04