Public Member Functions | Public Attributes | Private Member Functions
mtdevice.MTDevice Class Reference

MTDevice class. More...

List of all members.

Public Member Functions

def __init__
def AdjustUTCTime
def auto_config_legacy
def ChangeBaudrate
def configure_legacy
 High-level utility functions.
def GetAlignmentRotation
def GetAvailableScenarios
def GetBaudrate
def GetConfiguration
def GetCurrentScenario
def GetDeviceID
def GetErrorMode
def GetExtOutputMode
def GetFirmwareRev
def GetLatLonAlt
def GetLocationID
def GetOptionFlags
def GetOutputConfiguration
def GetOutputMode
def GetOutputSettings
def GetPeriod
def GetProductCode
def GetStringOutputType
def GetSyncSettings
def GetTransmitDelay
def GetUTCTime
def GoToConfig
def GoToMeasurement
def parse_MTData
def parse_MTData2
def read_data_msg
def read_measurement
def read_msg
def ReqDataLength
def Reset
 High-level functions.
def ResetOrientation
def RestoreFactoryDefaults
def RunSelfTest
def SetAlignmentRotation
def SetBaudrate
def SetCurrentScenario
def SetErrorMode
def SetExtOutputMode
def SetLatLonAlt
def SetLocationID
def SetNoRotation
def SetOptionFlags
def SetOutputConfiguration
def SetOutputMode
def SetOutputSettings
def SetOutputSkipFactor
def SetPeriod
def SetStringOutputType
def SetSyncSettings
def SetTransmitDelay
def SetUTCTime
def waitfor
def write_ack
def write_msg
 Low-level communication.

Public Attributes

 device
 header
 length
 mode
 scenario_id
 scenarios
 settings
 state
 timeout
 verbose

Private Member Functions

def _ensure_config_state
def _ensure_measurement_state

Detailed Description

MTDevice class.

XSens MT device communication object.

Definition at line 20 of file mtdevice.py.


Constructor & Destructor Documentation

def mtdevice.MTDevice.__init__ (   self,
  port,
  baudrate = 115200,
  timeout = 0.002,
  autoconf = True,
  config_mode = False,
  verbose = False 
)
Open device.

Definition at line 23 of file mtdevice.py.


Member Function Documentation

def mtdevice.MTDevice._ensure_config_state (   self) [private]
Switch device to config state if necessary.

Definition at line 177 of file mtdevice.py.

Switch device to measurement state if necessary.

Definition at line 182 of file mtdevice.py.

def mtdevice.MTDevice.AdjustUTCTime (   self,
  ticks 
)
Adjust UTC Time of device using correction ticks (0.1 ms).

Definition at line 588 of file mtdevice.py.

Read configuration from device in legacy mode.

Definition at line 620 of file mtdevice.py.

def mtdevice.MTDevice.ChangeBaudrate (   self,
  baudrate 
)
Change the baudrate, reset the device and reopen communication.

Definition at line 1090 of file mtdevice.py.

def mtdevice.MTDevice.configure_legacy (   self,
  mode,
  settings,
  period = None,
  skipfactor = None 
)

High-level utility functions.

Configure the mode and settings of the MT device in legacy mode.

Definition at line 597 of file mtdevice.py.

def mtdevice.MTDevice.GetAlignmentRotation (   self,
  parameter 
)
Get the object alignment.

parameter indicates the desired alignment quaternion:
    0 for sensor alignment (RotSensor),
    1 for local alignment (RotLocal).

Definition at line 415 of file mtdevice.py.

Get the available XKF scenarios on the device.

Definition at line 527 of file mtdevice.py.

Get the current baudrate id of the device.

Definition at line 250 of file mtdevice.py.

Ask for the current configuration of the MT device.

Definition at line 345 of file mtdevice.py.

Get the ID of the currently used XKF scenario.

Definition at line 543 of file mtdevice.py.

Get the device identifier.

Definition at line 217 of file mtdevice.py.

Get the current error mode of the device.

Definition at line 261 of file mtdevice.py.

Get current extended output mode (for alternative UART).

Definition at line 453 of file mtdevice.py.

Get the firmware version.

Definition at line 230 of file mtdevice.py.

Get the stored position of the device.
It is used internally for local magnetic declination and local gravity.

Definition at line 504 of file mtdevice.py.

Get the location ID of the device.

Definition at line 298 of file mtdevice.py.

Get the option flags (MTi-1 series).

Definition at line 285 of file mtdevice.py.

Get the output configuration of the device (mark IV).

Definition at line 374 of file mtdevice.py.

Get current output mode.

Definition at line 439 of file mtdevice.py.

Get current output mode.

Definition at line 466 of file mtdevice.py.

Get the sampling period.

Definition at line 402 of file mtdevice.py.

Get the product code.

Definition at line 224 of file mtdevice.py.

Get the NMEA data output configuration.

Definition at line 389 of file mtdevice.py.

Get the synchronisation settings.

Definition at line 330 of file mtdevice.py.

Get the transmission delay (only RS485).

Definition at line 317 of file mtdevice.py.

Get UTC time from device.

Definition at line 573 of file mtdevice.py.

Place MT device in configuration mode.

Definition at line 206 of file mtdevice.py.

Place MT device in measurement mode.

Definition at line 211 of file mtdevice.py.

def mtdevice.MTDevice.parse_MTData (   self,
  data,
  mode = None,
  settings = None 
)
Read and parse a legacy measurement packet.

Definition at line 966 of file mtdevice.py.

def mtdevice.MTDevice.parse_MTData2 (   self,
  data 
)

Definition at line 638 of file mtdevice.py.

def mtdevice.MTDevice.read_data_msg (   self,
  buf = bytearray() 
)
Low-level MTData receiving function.
Take advantage of known message length.

Definition at line 90 of file mtdevice.py.

def mtdevice.MTDevice.read_measurement (   self,
  mode = None,
  settings = None 
)

Definition at line 625 of file mtdevice.py.

Low-level message receiving function.

Definition at line 127 of file mtdevice.py.

Get data length for mark III devices.

Definition at line 486 of file mtdevice.py.

def mtdevice.MTDevice.Reset (   self,
  go_to_config = False 
)

High-level functions.

Reset MT device.

If go_to_config then send WakeUpAck in order to leave the device in
config mode.

Definition at line 190 of file mtdevice.py.

def mtdevice.MTDevice.ResetOrientation (   self,
  code 
)
Reset the orientation.

Code can take several values:
    0x0000: store current settings (only in config mode),
    0x0001: heading reset (NOT supported by MTi-G),
    0x0003: object reset.

Definition at line 556 of file mtdevice.py.

Restore MT device configuration to factory defaults (soft version).

Definition at line 311 of file mtdevice.py.

Run the built-in self test.

Definition at line 239 of file mtdevice.py.

def mtdevice.MTDevice.SetAlignmentRotation (   self,
  parameter,
  quaternion 
)
Set the object alignment.

parameter indicates the desired alignment quaternion:
    0 for sensor alignment (RotSensor),
    1 for local alignment (RotLocal).

Definition at line 428 of file mtdevice.py.

def mtdevice.MTDevice.SetBaudrate (   self,
  brid 
)
Set the baudrate of the device using the baudrate id.

Definition at line 256 of file mtdevice.py.

def mtdevice.MTDevice.SetCurrentScenario (   self,
  scenario_id 
)
Sets the XKF scenario to use.

Definition at line 550 of file mtdevice.py.

def mtdevice.MTDevice.SetErrorMode (   self,
  error_mode 
)
Set the error mode of the device.

The error mode defines the way the device deals with errors (expect
message errors):
    0x0000: ignore any errors except message handling errors,
    0x0001: in case of missing sampling instance: increase sample
counter and do not send error message,
    0x0002: in case of missing sampling instance: increase sample
counter and send error message,
    0x0003: in case of non-message handling error, an error message is
sent and the device will go into Config State.

Definition at line 268 of file mtdevice.py.

def mtdevice.MTDevice.SetExtOutputMode (   self,
  ext_mode 
)
Set extended output mode (for alternative UART).

Definition at line 460 of file mtdevice.py.

def mtdevice.MTDevice.SetLatLonAlt (   self,
  lat,
  lon,
  alt 
)
Set the position of the device.
It is used internally for local magnetic declination and local gravity.

Definition at line 519 of file mtdevice.py.

def mtdevice.MTDevice.SetLocationID (   self,
  location_id 
)
Set the location ID of the device (arbitrary).

Definition at line 305 of file mtdevice.py.

def mtdevice.MTDevice.SetNoRotation (   self,
  duration 
)
Initiate the "no rotation" procedure to estimate gyro biases.

Definition at line 567 of file mtdevice.py.

def mtdevice.MTDevice.SetOptionFlags (   self,
  set_flags,
  clear_flags 
)
Set the option flags (MTi-1 series).

Definition at line 292 of file mtdevice.py.

def mtdevice.MTDevice.SetOutputConfiguration (   self,
  output_configuration 
)
Set the output configuration of the device (mark IV).

Definition at line 382 of file mtdevice.py.

def mtdevice.MTDevice.SetOutputMode (   self,
  mode 
)
Select which information to output.

Definition at line 446 of file mtdevice.py.

def mtdevice.MTDevice.SetOutputSettings (   self,
  settings 
)
Select how to output the information.

Definition at line 473 of file mtdevice.py.

def mtdevice.MTDevice.SetOutputSkipFactor (   self,
  skipfactor 
)
Set the output skip factor.

Definition at line 480 of file mtdevice.py.

def mtdevice.MTDevice.SetPeriod (   self,
  period 
)
Set the sampling period.

Definition at line 409 of file mtdevice.py.

def mtdevice.MTDevice.SetStringOutputType (   self,
  string_output_type 
)
Set the configuration of the NMEA data output.

Definition at line 396 of file mtdevice.py.

def mtdevice.MTDevice.SetSyncSettings (   self,
  sync_settings 
)
Set the synchronisation settings (mark IV)

Definition at line 338 of file mtdevice.py.

def mtdevice.MTDevice.SetTransmitDelay (   self,
  transmit_delay 
)
Set the transmission delay (only RS485).

Definition at line 324 of file mtdevice.py.

def mtdevice.MTDevice.SetUTCTime (   self,
  ns,
  year,
  month,
  day,
  hour,
  minute,
  second,
  flag 
)
Set UTC time on the device.

Definition at line 581 of file mtdevice.py.

def mtdevice.MTDevice.waitfor (   self,
  size = 1 
)
Get a given amount of data.

Definition at line 78 of file mtdevice.py.

def mtdevice.MTDevice.write_ack (   self,
  mid,
  data = b'',
  n_retries = 500 
)
Send a message and read confirmation.

Definition at line 161 of file mtdevice.py.

def mtdevice.MTDevice.write_msg (   self,
  mid,
  data = b'' 
)

Low-level communication.

Low-level message sending function.

Definition at line 59 of file mtdevice.py.


Member Data Documentation

Definition at line 23 of file mtdevice.py.

Definition at line 23 of file mtdevice.py.

Definition at line 23 of file mtdevice.py.

Definition at line 23 of file mtdevice.py.

Definition at line 543 of file mtdevice.py.

Definition at line 527 of file mtdevice.py.

Definition at line 23 of file mtdevice.py.

Definition at line 23 of file mtdevice.py.

Definition at line 23 of file mtdevice.py.

Definition at line 23 of file mtdevice.py.


The documentation for this class was generated from the following file:


xsens_driver
Author(s):
autogenerated on Sat Aug 19 2017 03:01:10