13
Document MT0605P.2018.E
© Xsens Technologies B.V.
MTi User Manual
3.6.3 Using the Software Development Kit (SDK)
This chapter gives an introduction to the Xsens Device API (XDA). It serves as a starting point for system
integrators interested in assessing the basis of the SDK and knowing about the background
considerations. The main objective of the SDK is to facilitate easy development of user-specific host
applications based on Xsens motion trackers.
The MT SDK 4.x (and the MT Software Suite) is designed for the MTi 1-series, MTi 10-series and MTi
100-series.
3.6.3.1 Using the Source code and Dynamic Library
The MT SDK consists of Source code and a Dynamic Library. Source code is made available in C, since
this language can be handled by many other programming languages, such as C++, Java and Python.
Since C++ is a more convenient language to use for first-time users of the MT SDK (lower risk of making
mistakes, easier to handle complex functions), Xsens also supplies a C++ wrapper around the C-
compiled library. Refer to the MT SDK documentation in the Xsens installation folder to find schematic
overview of the Xsens Device API. The host application developer can choose to use a COM, C, C# or
C++ interface. However, only the C interface is delivered as a compiled dynamic library. For the C# and
C++ interface the source code of the wrapper classes are supplied as part of the SDK. The interfaces
are discussed in more detail in the following sections.
Note that conceptually XDA makes no distinction between the cases of real-time data stream from a
device or a recorded file data stream.
Using the Xsens Xbus low-level communication protocol is discussed in section 3.6.4.
Device management and global control functions are grouped in the XsControl object. To access
functionality for a specific device the XsDevice object is available. Typical steps are:
1. Scan for Xsens devices with XsScanner::scanPorts
2. Open port with XsControl::openPort and get device object with XsControl::device
3. Configure device with XsDevice functions
4. Start measuring
C-interface libraries
XDA is implemented in two C-interface libraries that are supplied for Windows and Linux, consisting of
two parts:
XDA that contains the access to functionality as implemented in devices, e.g. configuring the Motion
Trackers, requesting data etc
XsTypes that contains generic types (vectors, matrices, quaternions, etc.) and some basic
operations on those types, e.g. converting quaternions coming from the MTi into Euler angles.
The C API exposes all possible functions that could be supported by an Xsens device. As such, a certain
functionality implemented in devices is accessible by a function call that takes at least an XsDevice
Object as a parameter. Not every Xsens device supports all functionality, e.g. an MTi-30 does not
support getting a position estimate whereas the MTi-G-710 does. This means that whether the function
returns a meaningful result depends on the type of connected device. The DeviceID indicates the MTi
product with associated functionality: a list of DeviceIDs can be found in section 3.2.5. Exposing all the
possible functionalities has the advantage that when changing the MTi in the application to a device with
other functionalities, the majority of the code can remain unchanged.