1 """Constant and messages definition for MT communication.""" 5 """State of the device""" 13 """Values for the message id (MID)""" 25 GoToMeasurement = 0x10
45 RestoreFactoryDef = 0x0E
55 SetTransmitDelay = 0xDC
63 SetSyncSettings = 0x2C
67 ReqConfiguration = 0x0C
73 SetExtOutputMode = 0x86
75 SetOutputConfiguration = 0xC0
77 SetStringOutputType = 0x8E
79 SetAlignmentRotation = 0xEC
83 SetOutputSettings = 0xD2
95 ResetOrientation = 0xA4
103 ReqAvailableScenarios = 0x62
105 AvailableScenarios = 0x63
107 SetCurrentScenario = 0x64
109 SetGravityMagnitude = 0x66
118 """Deprecated message Ids.""" 134 SetSyncInSettings = 0xD6
136 SetSyncOutSettings = 0xD8
140 SetOutputSkipFactor = 0xD4
142 SetObjectAlignment = 0xE0
149 SetLeverArmGPS = 0x68
151 SetMagneticDeclination = 0x6A
154 SetProcessingFlags = 0x20
158 '''Return the name of the first found member of class cls with given 160 for k, v
in cls.__dict__.iteritems():
167 '''Return the name of a message given the message id.''' 179 """Baudrate information and conversion.""" 199 """Get baudrate id for a given baudrate.""" 207 """Get baudrate for a given baudrate id.""" 209 if baudrate_id == brid:
215 """Values for the output mode.""" 228 """Values for the output settings.""" 229 Timestamp_None = 0x00000000
230 Timestamp_SampleCnt = 0x00000001
231 Timestamp_UTCTime = 0x00000002
232 OrientMode_Quaternion = 0x00000000
233 OrientMode_Euler = 0x00000004
234 OrientMode_Matrix = 0x00000008
235 CalibMode_AccGyrMag = 0x00000000
236 CalibMode_GyrMag = 0x00000010
237 CalibMode_AccMag = 0x00000020
238 CalibMode_Mag = 0x00000030
239 CalibMode_AccGyr = 0x00000040
240 CalibMode_Gyr = 0x00000050
241 CalibMode_Acc = 0x00000060
242 CalibMode_Mask = 0x00000070
243 DataFormat_Float = 0x00000000
244 DataFormat_12_20 = 0x00000100
245 DataFormat_16_32 = 0x00000200
246 DataFormat_Double = 0x00000300
247 AuxiliaryMode_NoAIN1 = 0x00000400
248 AuxiliaryMode_NoAIN2 = 0x00000800
249 PositionMode_LLA_WGS84 = 0x00000000
250 VelocityMode_MS_XYZ = 0x00000000
251 Coordinates_NED = 0x80000000
255 """Values for the XDI groups.""" 258 OrientationData = 0x2000
260 Acceleration = 0x4000
263 AngularVelocity = 0x8000
265 SensorComponentReadout = 0xA000
285 return 'Timeout: %s' % self.
message 290 0:
"Operation was performed successfully",
291 1:
"No bus communication possible",
292 2:
"InitBus and/or SetBID are not issued",
293 3:
"Period sent is invalid",
294 4:
"The message is invalid or not implemented",
295 16:
"A slave did not respond to WaitForSetBID",
296 17:
"An incorrect answer received after WaitForSetBID",
297 18:
"After four bus-scans still undetected Motion Trackers",
298 20:
"No reply to SetBID message during SetBID procedure",
299 21:
"Other than SetBIDAck received",
300 24:
"Timer overflow - period too short to collect all data from Motion Trackers",
301 25:
"Motion Tracker responds with other than SlaveData message",
302 26:
"Total bytes of data of Motion Trackers including sample counter exceeds 255 bytes",
303 27:
"Timer overflows during measurement",
304 28:
"Timer overflows during measurement",
305 29:
"No correct response from Motion Tracker during measurement",
306 30:
"Timer overflows during measurement",
307 32:
"Baud rate does not comply with valid range",
308 33:
"An invalid parameter is supplied",
309 35:
"TX PC Buffer is full",
310 36:
"TX PC Buffer overflow, cannot fit full message",
311 37:
"Wireless subsystem failed",
312 40:
"The device generated an error, try updating the firmware",
313 41:
"The device generates more data than the bus communication can handle (baud rate may be too low)",
314 42:
"The sample buffer of the device was full during a communication outage",
315 43:
"The external trigger is not behaving as configured",
316 44:
"The sample stream detected an error in the ordering of sample data",
317 45:
"A dip in the power supply was detected and recovered from",
318 46:
"A current limiter has been activated, shutting down the device",
319 47:
"Device temperature is not within operational limits",
320 48:
"Battery level reached lower limit",
321 49:
"Specified filter profile ID is not available on the device or the user is trying to duplicate an existing filter profile type",
322 50:
"The settings stored in the device's non volatile memory are invalid",
323 256:
"A generic error occurred",
324 257:
"Operation not implemented in this version (yet)",
325 258:
"A timeout occurred",
326 259:
"Operation aborted because of no data read",
327 260:
"Checksum fault occurred",
328 261:
"No internal memory available",
329 262:
"The requested item was not found",
330 263:
"Unexpected message received (e.g. no acknowledge message received)",
331 264:
"Invalid id supplied",
332 265:
"Operation is invalid at this point",
333 266:
"Insufficient buffer space available",
334 267:
"The specified i/o device can not be opened",
335 268:
"The specified i/o device can not be opened",
336 269:
"An I/O device is already opened with this object",
337 270:
"End of file is reached",
338 271:
"A required settings file could not be opened or is missing some data",
339 272:
"No data is available",
340 273:
"Tried to change a read-only value",
341 274:
"Tried to supply a NULL value where it is not allowed",
342 275:
"Insufficient data was supplied to a function",
343 276:
"Busy processing, try again later",
344 277:
"Invalid instance called",
345 278:
"A trusted data stream proves to contain corrupted data",
346 279:
"Failure during read of settings",
347 280:
"Could not find any MVN-compatible hardware",
348 281:
"Found only one responding Xbus Master",
349 282:
"No xsens devices found",
350 283:
"One or more sensors are not where they were expected",
351 284:
"Not enough sensors were found",
352 285:
"Failure during initialization of Fusion Engine",
353 286:
"Something else was received than was requested",
354 287:
"No file opened for reading/writing",
355 288:
"No serial port opened for reading/writing",
356 289:
"No file or serial port opened for reading/writing",
357 290:
"A required port could not be found",
358 291:
"The low-level port handler failed to initialize",
359 292:
"A calibration routine failed",
360 293:
"The in-config check of the device failed",
361 294:
"The operation is once only and has already been performed",
362 295:
"The single connected device is configured as a slave",
363 296:
"More than one master was detected",
364 297:
"A device was detected that was neither master nor slave",
365 298:
"No master detected",
366 299:
"A device is not sending enough data",
367 300:
"The version of the object is too low for the requested operation",
368 301:
"The object has an unrecognised version, so it's not safe to perform the operation",
369 302:
"The process was aborted by an external event, usually a user action or process termination",
370 303:
"The requested functionality is not supported by the device",
371 304:
"A packet counter value was missed",
372 305:
"An error occurred while trying to put the device in measurement mode",
373 306:
"A device could not start recording",
374 311:
"Radio channel is in use by another system",
375 312:
"Motion tracker disconnected unexpectedly",
376 313:
"Too many motion trackers connected",
377 314:
"A device could not be put in config mode",
378 315:
"Device has gone out of range",
379 316:
"Device is back in range, resuming normal operation",
380 400:
"The device is shutting down " 385 self.
message = self.ErrorCodes.get(code,
'Unknown error: 0x%02X' % code)
388 return 'Error message 0x%02X: %s' % (self.
code, self.
message)
def __init__(self, message)
def get_BRID(cls, baudrate)
def __init__(self, message)
def get_BR(cls, baudrate_id)