Public Member Functions | |
def | __init__ |
def | auto_config |
Read configuration from device. | |
def | ChangeBaudrate |
Change the baudrate, reset the device and reopen communication. | |
def | configure |
High-level utility functions. | |
def | GetOutputMode |
Get current output mode. | |
def | GetOutputSettings |
Get current output mode. | |
def | GoToConfig |
Place MT device in configuration mode. | |
def | GoToMeasurement |
Place MT device in measurement mode. | |
def | parse_MTData |
Parse a legacy MTData message. | |
def | parse_MTData2 |
Parse a new MTData2 message. | |
def | read_data_msg |
Low-level MTData receiving function. | |
def | read_measurement |
Read and parse a measurement packet. | |
def | read_msg |
Low-level message receiving function. | |
def | ReqAvailableScenarios |
Request the available XKF scenarios on the device. | |
def | ReqConfiguration |
Ask for the current configuration of the MT device. | |
def | ReqCurrentScenario |
Request the ID of the currently used XKF scenario. | |
def | ReqDataLength |
Get data length. | |
def | Reset |
High-level functions. | |
def | RestoreFactoryDefaults |
Restore MT device configuration to factory defaults (soft version). | |
def | SetBaudrate |
Set the baudrate of the device using the baudrate id. | |
def | SetCurrentScenario |
Sets the XKF scenario to use. | |
def | SetOutputMode |
Select which information to output. | |
def | SetOutputSettings |
Select how to output the information. | |
def | SetOutputSkipFactor |
Set the output skip factor. | |
def | SetPeriod |
Set the period of sampling. | |
def | write_ack |
Send a message and read confirmation. | |
def | write_msg |
Low-level communication. | |
Public Attributes | |
device | |
serial interface to the device | |
header | |
header of the MTData message | |
length | |
length of the MTData message | |
mode | |
mode parameter of the IMU | |
scenario_label | |
current XKF id | |
scenarios | |
available XKF scenarios | |
settings | |
settings parameter of the IMU | |
timeout | |
timeout for communication |
MTDevice class.
XSens MT device communication object.
XSens MT device communication object.
Definition at line 16 of file mtdevice.py.
def mtdevice.MTDevice.__init__ | ( | self, | |
port, | |||
baudrate = 115200 , |
|||
timeout = 0.001 , |
|||
autoconf = True , |
|||
config_mode = False |
|||
) |
Open device.
Definition at line 19 of file mtdevice.py.
def mtdevice.MTDevice.auto_config | ( | self | ) |
Read configuration from device.
Read configuration from device.
Definition at line 378 of file mtdevice.py.
def mtdevice.MTDevice.ChangeBaudrate | ( | self, | |
baudrate | |||
) |
Change the baudrate, reset the device and reopen communication.
Change the baudrate, reset the device and reopen communication.
Definition at line 726 of file mtdevice.py.
def mtdevice.MTDevice.configure | ( | self, | |
mode, | |||
settings, | |||
period = None , |
|||
skipfactor = None |
|||
) |
High-level utility functions.
Configure the mode and settings of the MT device.
Configure the mode and settings of the MT device.
Definition at line 361 of file mtdevice.py.
def mtdevice.MTDevice.GetOutputMode | ( | self | ) |
Get current output mode.
Assume the device is in Config state.
Get current output mode. Assume the device is in Config state.
Definition at line 203 of file mtdevice.py.
def mtdevice.MTDevice.GetOutputSettings | ( | self | ) |
Get current output mode.
Assume the device is in Config state.
Get current output mode. Assume the device is in Config state.
Definition at line 223 of file mtdevice.py.
def mtdevice.MTDevice.GoToConfig | ( | self | ) |
Place MT device in configuration mode.
Place MT device in configuration mode.
Definition at line 182 of file mtdevice.py.
def mtdevice.MTDevice.GoToMeasurement | ( | self | ) |
Place MT device in measurement mode.
Place MT device in measurement mode.
Definition at line 188 of file mtdevice.py.
def mtdevice.MTDevice.parse_MTData | ( | self, | |
data, | |||
mode = None , |
|||
settings = None |
|||
) |
Parse a legacy MTData message.
Read and parse a measurement packet.
Definition at line 624 of file mtdevice.py.
def mtdevice.MTDevice.parse_MTData2 | ( | self, | |
data | |||
) |
Parse a new MTData2 message.
Definition at line 404 of file mtdevice.py.
def mtdevice.MTDevice.read_data_msg | ( | self, | |
buf = bytearray() |
|||
) |
Low-level MTData receiving function.
Take advantage of known message length.
Low-level MTData receiving function. Take advantage of known message length.
Definition at line 68 of file mtdevice.py.
def mtdevice.MTDevice.read_measurement | ( | self, | |
mode = None , |
|||
settings = None |
|||
) |
Read and parse a measurement packet.
Definition at line 392 of file mtdevice.py.
def mtdevice.MTDevice.read_msg | ( | self | ) |
Low-level message receiving function.
Low-level message receiving function.
Definition at line 104 of file mtdevice.py.
def mtdevice.MTDevice.ReqAvailableScenarios | ( | self | ) |
Request the available XKF scenarios on the device.
Assume the device is in Config state.
Request the available XKF scenarios on the device. Assume the device is in Config state.
Definition at line 310 of file mtdevice.py.
def mtdevice.MTDevice.ReqConfiguration | ( | self | ) |
Ask for the current configuration of the MT device.
Assume the device is in Config state.
Ask for the current configuration of the MT device. Assume the device is in Config state.
Definition at line 273 of file mtdevice.py.
def mtdevice.MTDevice.ReqCurrentScenario | ( | self | ) |
Request the ID of the currently used XKF scenario.
Assume the device is in Config state.
Request the ID of the currently used XKF scenario. Assume the device is in Config state.
Definition at line 329 of file mtdevice.py.
def mtdevice.MTDevice.ReqDataLength | ( | self | ) |
Get data length.
Assume the device is in Config state.
Get data length. Assume the device is in Config state.
Definition at line 262 of file mtdevice.py.
def mtdevice.MTDevice.Reset | ( | self | ) |
def mtdevice.MTDevice.RestoreFactoryDefaults | ( | self | ) |
Restore MT device configuration to factory defaults (soft version).
Restore MT device configuration to factory defaults (soft version).
Definition at line 194 of file mtdevice.py.
def mtdevice.MTDevice.SetBaudrate | ( | self, | |
brid | |||
) |
Set the baudrate of the device using the baudrate id.
Assume the device is in Config state.
Set the baudrate of the device using the baudrate id. Assume the device is in Config state.
Definition at line 302 of file mtdevice.py.
def mtdevice.MTDevice.SetCurrentScenario | ( | self, | |
scenario_id | |||
) |
Sets the XKF scenario to use.
Assume the device is in Config state.
Sets the XKF scenario to use. Assume the device is in Config state.
Definition at line 351 of file mtdevice.py.
def mtdevice.MTDevice.SetOutputMode | ( | self, | |
mode | |||
) |
Select which information to output.
Assume the device is in Config state.
Select which information to output. Assume the device is in Config state.
Definition at line 213 of file mtdevice.py.
def mtdevice.MTDevice.SetOutputSettings | ( | self, | |
settings | |||
) |
Select how to output the information.
Assume the device is in Config state.
Select how to output the information. Assume the device is in Config state.
Definition at line 233 of file mtdevice.py.
def mtdevice.MTDevice.SetOutputSkipFactor | ( | self, | |
skipfactor | |||
) |
Set the output skip factor.
Assume the device is in Config state.
Set the output skip factor. Assume the device is in Config state.
Definition at line 253 of file mtdevice.py.
def mtdevice.MTDevice.SetPeriod | ( | self, | |
period | |||
) |
Set the period of sampling.
Assume the device is in Config state.
Set the period of sampling. Assume the device is in Config state.
Definition at line 244 of file mtdevice.py.
def mtdevice.MTDevice.write_ack | ( | self, | |
mid, | |||
data = [] |
|||
) |
Send a message and read confirmation.
Send a message a read confirmation.
Definition at line 158 of file mtdevice.py.
def mtdevice.MTDevice.write_msg | ( | self, | |
mid, | |||
data = [] |
|||
) |
Low-level communication.
Low-level message sending function.
Low-level message sending function.
Definition at line 48 of file mtdevice.py.
serial interface to the device
Definition at line 20 of file mtdevice.py.
header of the MTData message
Definition at line 25 of file mtdevice.py.
length of the MTData message
Definition at line 24 of file mtdevice.py.
mode parameter of the IMU
Definition at line 22 of file mtdevice.py.
available XKF scenarios
Definition at line 312 of file mtdevice.py.
settings parameter of the IMU
Definition at line 23 of file mtdevice.py.
timeout for communication
Definition at line 21 of file mtdevice.py.