Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
xsens_driver.mtdevice.MTDevice Class Reference

MTDevice class. More...

Inheritance diagram for xsens_driver.mtdevice.MTDevice:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, port, baudrate=115200, timeout=0.002, autoconf=True, config_mode=False, verbose=False, initial_wait=0.1)
 
def AdjustUTCTime (self, ticks)
 
def auto_config_legacy (self)
 
def ChangeBaudrate (self, baudrate)
 
def configure_legacy (self, mode, settings, period=None, skipfactor=None)
 High-level utility functions. More...
 
def GetAlignmentRotation (self, parameter)
 
def GetAvailableScenarios (self)
 
def GetBaudrate (self)
 
def GetConfiguration (self)
 
def GetCurrentScenario (self)
 
def GetDeviceID (self)
 
def GetErrorMode (self)
 
def GetExtOutputMode (self)
 
def GetFirmwareRev (self)
 
def GetGnssPlatform (self)
 
def GetHardwareVersion (self)
 
def GetLatLonAlt (self)
 
def GetLocationID (self)
 
def GetOptionFlags (self)
 
def GetOutputConfiguration (self)
 
def GetOutputMode (self)
 
def GetOutputSettings (self)
 
def GetPeriod (self)
 
def GetProductCode (self)
 
def GetStringOutputType (self)
 
def GetSyncSettings (self)
 
def GetTransmitDelay (self)
 
def GetUTCTime (self)
 
def GoToConfig (self)
 
def GoToMeasurement (self)
 
def IccCommand (self, command)
 
def parse_MTData (self, data, mode=None, settings=None)
 
def parse_MTData2 (self, data)
 
def read_data_msg (self, buf=bytearray())
 
def read_measurement (self, mode=None, settings=None)
 
def read_msg (self)
 
def ReqDataLength (self)
 
def Reset (self, go_to_config=False)
 High-level functions. More...
 
def ResetOrientation (self, code)
 
def RestoreFactoryDefaults (self)
 
def RunSelfTest (self)
 
def SetAlignmentRotation (self, parameter, quaternion)
 
def SetBaudrate (self, brid)
 
def SetCurrentScenario (self, scenario_id)
 
def SetErrorMode (self, error_mode)
 
def SetExtOutputMode (self, ext_mode)
 
def SetGnssPlatform (self, platform)
 
def SetLatLonAlt (self, lat, lon, alt)
 
def SetLocationID (self, location_id)
 
def SetNoRotation (self, duration)
 
def SetOptionFlags (self, set_flags, clear_flags)
 
def SetOutputConfiguration (self, output_configuration)
 
def SetOutputMode (self, mode)
 
def SetOutputSettings (self, settings)
 
def SetOutputSkipFactor (self, skipfactor)
 
def SetPeriod (self, period)
 
def SetStringOutputType (self, string_output_type)
 
def SetSyncSettings (self, sync_settings)
 
def SetTransmitDelay (self, transmit_delay)
 
def SetUTCTime (self, ns, year, month, day, hour, minute, second, flag)
 
def waitfor (self, size=1)
 
def write_ack (self, mid, data=b'', n_resend=30, n_read=25)
 
def write_msg (self, mid, data=b'')
 Low-level communication. More...
 

Public Attributes

 device
 
 header
 
 length
 
 mode
 
 scenario_id
 
 scenarios
 
 settings
 
 state
 
 timeout
 
 verbose
 

Static Public Attributes

def GetAvailableFilterProfiles = GetAvailableScenarios
 
def GetFilterProfile = GetCurrentScenario
 
def SetFilterProfile = SetCurrentScenario
 

Private Member Functions

def _ensure_config_state (self)
 
def _ensure_measurement_state (self)
 

Detailed Description

MTDevice class.

XSens MT device communication object.

Definition at line 27 of file src/xsens_driver/mtdevice.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 31 of file src/xsens_driver/mtdevice.py.

Member Function Documentation

◆ _ensure_config_state()

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

Definition at line 193 of file src/xsens_driver/mtdevice.py.

◆ _ensure_measurement_state()

def xsens_driver.mtdevice.MTDevice._ensure_measurement_state (   self)
private
Switch device to measurement state if necessary.

Definition at line 198 of file src/xsens_driver/mtdevice.py.

◆ AdjustUTCTime()

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

Definition at line 640 of file src/xsens_driver/mtdevice.py.

◆ auto_config_legacy()

def xsens_driver.mtdevice.MTDevice.auto_config_legacy (   self)
Read configuration from device in legacy mode.

Definition at line 694 of file src/xsens_driver/mtdevice.py.

◆ ChangeBaudrate()

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

Definition at line 1167 of file src/xsens_driver/mtdevice.py.

◆ configure_legacy()

def xsens_driver.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 671 of file src/xsens_driver/mtdevice.py.

◆ GetAlignmentRotation()

def xsens_driver.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 441 of file src/xsens_driver/mtdevice.py.

◆ GetAvailableScenarios()

def xsens_driver.mtdevice.MTDevice.GetAvailableScenarios (   self)
Get the available XKF scenarios on the device.

Definition at line 561 of file src/xsens_driver/mtdevice.py.

◆ GetBaudrate()

def xsens_driver.mtdevice.MTDevice.GetBaudrate (   self)
Get the current baudrate id of the device.

Definition at line 276 of file src/xsens_driver/mtdevice.py.

◆ GetConfiguration()

def xsens_driver.mtdevice.MTDevice.GetConfiguration (   self)
Ask for the current configuration of the MT device.

Definition at line 371 of file src/xsens_driver/mtdevice.py.

◆ GetCurrentScenario()

def xsens_driver.mtdevice.MTDevice.GetCurrentScenario (   self)
Get the ID of the currently used XKF scenario.

Definition at line 577 of file src/xsens_driver/mtdevice.py.

◆ GetDeviceID()

def xsens_driver.mtdevice.MTDevice.GetDeviceID (   self)
Get the device identifier.

Definition at line 233 of file src/xsens_driver/mtdevice.py.

◆ GetErrorMode()

def xsens_driver.mtdevice.MTDevice.GetErrorMode (   self)
Get the current error mode of the device.

Definition at line 287 of file src/xsens_driver/mtdevice.py.

◆ GetExtOutputMode()

def xsens_driver.mtdevice.MTDevice.GetExtOutputMode (   self)
Get current extended output mode (for alternative UART).

Definition at line 487 of file src/xsens_driver/mtdevice.py.

◆ GetFirmwareRev()

def xsens_driver.mtdevice.MTDevice.GetFirmwareRev (   self)
Get the firmware version.

Definition at line 253 of file src/xsens_driver/mtdevice.py.

◆ GetGnssPlatform()

def xsens_driver.mtdevice.MTDevice.GetGnssPlatform (   self)
Get the current GNSS navigation filter settings.

Definition at line 595 of file src/xsens_driver/mtdevice.py.

◆ GetHardwareVersion()

def xsens_driver.mtdevice.MTDevice.GetHardwareVersion (   self)
Get the hardware version.

Definition at line 246 of file src/xsens_driver/mtdevice.py.

◆ GetLatLonAlt()

def xsens_driver.mtdevice.MTDevice.GetLatLonAlt (   self)
Get the stored position of the device.
It is used internally for local magnetic declination and local gravity.

Definition at line 538 of file src/xsens_driver/mtdevice.py.

◆ GetLocationID()

def xsens_driver.mtdevice.MTDevice.GetLocationID (   self)
Get the location ID of the device.

Definition at line 324 of file src/xsens_driver/mtdevice.py.

◆ GetOptionFlags()

def xsens_driver.mtdevice.MTDevice.GetOptionFlags (   self)
Get the option flags (MTi-1 series).

Definition at line 311 of file src/xsens_driver/mtdevice.py.

◆ GetOutputConfiguration()

def xsens_driver.mtdevice.MTDevice.GetOutputConfiguration (   self)
Get the output configuration of the device (mark IV).

Definition at line 400 of file src/xsens_driver/mtdevice.py.

◆ GetOutputMode()

def xsens_driver.mtdevice.MTDevice.GetOutputMode (   self)
Get current output mode.

Definition at line 473 of file src/xsens_driver/mtdevice.py.

◆ GetOutputSettings()

def xsens_driver.mtdevice.MTDevice.GetOutputSettings (   self)
Get current output mode.

Definition at line 500 of file src/xsens_driver/mtdevice.py.

◆ GetPeriod()

def xsens_driver.mtdevice.MTDevice.GetPeriod (   self)
Get the sampling period.

Definition at line 428 of file src/xsens_driver/mtdevice.py.

◆ GetProductCode()

def xsens_driver.mtdevice.MTDevice.GetProductCode (   self)
Get the product code.

Definition at line 240 of file src/xsens_driver/mtdevice.py.

◆ GetStringOutputType()

def xsens_driver.mtdevice.MTDevice.GetStringOutputType (   self)
Get the NMEA data output configuration.

Definition at line 415 of file src/xsens_driver/mtdevice.py.

◆ GetSyncSettings()

def xsens_driver.mtdevice.MTDevice.GetSyncSettings (   self)
Get the synchronisation settings.

Definition at line 356 of file src/xsens_driver/mtdevice.py.

◆ GetTransmitDelay()

def xsens_driver.mtdevice.MTDevice.GetTransmitDelay (   self)
Get the transmission delay (only RS485).

Definition at line 343 of file src/xsens_driver/mtdevice.py.

◆ GetUTCTime()

def xsens_driver.mtdevice.MTDevice.GetUTCTime (   self)
Get UTC time from device.

Definition at line 625 of file src/xsens_driver/mtdevice.py.

◆ GoToConfig()

def xsens_driver.mtdevice.MTDevice.GoToConfig (   self)
Place MT device in configuration mode.

Definition at line 222 of file src/xsens_driver/mtdevice.py.

◆ GoToMeasurement()

def xsens_driver.mtdevice.MTDevice.GoToMeasurement (   self)
Place MT device in measurement mode.

Definition at line 227 of file src/xsens_driver/mtdevice.py.

◆ IccCommand()

def xsens_driver.mtdevice.MTDevice.IccCommand (   self,
  command 
)
Command of In-run Compass Calibration (ICC).

Definition at line 646 of file src/xsens_driver/mtdevice.py.

◆ parse_MTData()

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

Definition at line 1042 of file src/xsens_driver/mtdevice.py.

◆ parse_MTData2()

def xsens_driver.mtdevice.MTDevice.parse_MTData2 (   self,
  data 
)

Definition at line 712 of file src/xsens_driver/mtdevice.py.

◆ read_data_msg()

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

Definition at line 101 of file src/xsens_driver/mtdevice.py.

◆ read_measurement()

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

Definition at line 699 of file src/xsens_driver/mtdevice.py.

◆ read_msg()

def xsens_driver.mtdevice.MTDevice.read_msg (   self)
Low-level message receiving function.

Definition at line 138 of file src/xsens_driver/mtdevice.py.

◆ ReqDataLength()

def xsens_driver.mtdevice.MTDevice.ReqDataLength (   self)
Get data length for mark III devices.

Definition at line 520 of file src/xsens_driver/mtdevice.py.

◆ Reset()

def xsens_driver.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 206 of file src/xsens_driver/mtdevice.py.

◆ ResetOrientation()

def xsens_driver.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 608 of file src/xsens_driver/mtdevice.py.

◆ RestoreFactoryDefaults()

def xsens_driver.mtdevice.MTDevice.RestoreFactoryDefaults (   self)
Restore MT device configuration to factory defaults (soft version).

Definition at line 337 of file src/xsens_driver/mtdevice.py.

◆ RunSelfTest()

def xsens_driver.mtdevice.MTDevice.RunSelfTest (   self)
Run the built-in self test.

Definition at line 265 of file src/xsens_driver/mtdevice.py.

◆ SetAlignmentRotation()

def xsens_driver.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 462 of file src/xsens_driver/mtdevice.py.

◆ SetBaudrate()

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

Definition at line 282 of file src/xsens_driver/mtdevice.py.

◆ SetCurrentScenario()

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

Definition at line 584 of file src/xsens_driver/mtdevice.py.

◆ SetErrorMode()

def xsens_driver.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 294 of file src/xsens_driver/mtdevice.py.

◆ SetExtOutputMode()

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

Definition at line 494 of file src/xsens_driver/mtdevice.py.

◆ SetGnssPlatform()

def xsens_driver.mtdevice.MTDevice.SetGnssPlatform (   self,
  platform 
)
Set the GNSS navigation filter settings.

Definition at line 602 of file src/xsens_driver/mtdevice.py.

◆ SetLatLonAlt()

def xsens_driver.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 553 of file src/xsens_driver/mtdevice.py.

◆ SetLocationID()

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

Definition at line 331 of file src/xsens_driver/mtdevice.py.

◆ SetNoRotation()

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

Definition at line 619 of file src/xsens_driver/mtdevice.py.

◆ SetOptionFlags()

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

Definition at line 318 of file src/xsens_driver/mtdevice.py.

◆ SetOutputConfiguration()

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

Definition at line 408 of file src/xsens_driver/mtdevice.py.

◆ SetOutputMode()

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

Definition at line 480 of file src/xsens_driver/mtdevice.py.

◆ SetOutputSettings()

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

Definition at line 507 of file src/xsens_driver/mtdevice.py.

◆ SetOutputSkipFactor()

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

Definition at line 514 of file src/xsens_driver/mtdevice.py.

◆ SetPeriod()

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

Definition at line 435 of file src/xsens_driver/mtdevice.py.

◆ SetStringOutputType()

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

Definition at line 422 of file src/xsens_driver/mtdevice.py.

◆ SetSyncSettings()

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

Definition at line 364 of file src/xsens_driver/mtdevice.py.

◆ SetTransmitDelay()

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

Definition at line 350 of file src/xsens_driver/mtdevice.py.

◆ SetUTCTime()

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

Definition at line 633 of file src/xsens_driver/mtdevice.py.

◆ waitfor()

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

Definition at line 89 of file src/xsens_driver/mtdevice.py.

◆ write_ack()

def xsens_driver.mtdevice.MTDevice.write_ack (   self,
  mid,
  data = b'',
  n_resend = 30,
  n_read = 25 
)
Send a message and read confirmation.

Definition at line 172 of file src/xsens_driver/mtdevice.py.

◆ write_msg()

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

Low-level communication.

Low-level message sending function.

Definition at line 67 of file src/xsens_driver/mtdevice.py.

Member Data Documentation

◆ device

xsens_driver.mtdevice.MTDevice.device

Definition at line 36 of file src/xsens_driver/mtdevice.py.

◆ GetAvailableFilterProfiles

def xsens_driver.mtdevice.MTDevice.GetAvailableFilterProfiles = GetAvailableScenarios
static

Definition at line 591 of file src/xsens_driver/mtdevice.py.

◆ GetFilterProfile

def xsens_driver.mtdevice.MTDevice.GetFilterProfile = GetCurrentScenario
static

Definition at line 592 of file src/xsens_driver/mtdevice.py.

◆ header

xsens_driver.mtdevice.MTDevice.header

Definition at line 60 of file src/xsens_driver/mtdevice.py.

◆ length

xsens_driver.mtdevice.MTDevice.length

Definition at line 58 of file src/xsens_driver/mtdevice.py.

◆ mode

xsens_driver.mtdevice.MTDevice.mode

Definition at line 54 of file src/xsens_driver/mtdevice.py.

◆ scenario_id

xsens_driver.mtdevice.MTDevice.scenario_id

Definition at line 581 of file src/xsens_driver/mtdevice.py.

◆ scenarios

xsens_driver.mtdevice.MTDevice.scenarios

Definition at line 572 of file src/xsens_driver/mtdevice.py.

◆ SetFilterProfile

def xsens_driver.mtdevice.MTDevice.SetFilterProfile = SetCurrentScenario
static

Definition at line 593 of file src/xsens_driver/mtdevice.py.

◆ settings

xsens_driver.mtdevice.MTDevice.settings

Definition at line 56 of file src/xsens_driver/mtdevice.py.

◆ state

xsens_driver.mtdevice.MTDevice.state

Definition at line 49 of file src/xsens_driver/mtdevice.py.

◆ timeout

xsens_driver.mtdevice.MTDevice.timeout

Definition at line 47 of file src/xsens_driver/mtdevice.py.

◆ verbose

xsens_driver.mtdevice.MTDevice.verbose

Definition at line 33 of file src/xsens_driver/mtdevice.py.


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


xsens_driver
Author(s):
autogenerated on Tue May 2 2023 02:05:55