Document MT0605P.E
© Xsens Technologies B.V.
MTi User Manual
13
C-interface libraries
XDA is implemented in two C-interface libraries that are supplied for MS 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 (
– Linux only available as beta via
)
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 does
not support getting a position estimate whereas the MTi-G does. This means that whether the function
returns a meaningful result depends on the connected device. The DeviceID indicates the MTi product
with associated functionality: a list of DeviceIDs can be found in section 2.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.
Internally the Xsens host software is implemented using an object oriented approach in which the
functionality is only implemented in subclasses, see schematic below.
It is important for the developer to use only functions supported by the connected device. During run
time, calling an unsupported function will generate an error status in line with the normal error handling
framework.
C++ interface
To offer the convenience of object-lifetime management to developers, the XDA is also offered as a
C++ interface which basically implements a convenience wrapper around the C API. This means that
the developer does not have to deal with memory management (i.e. easy object-lifetime management)
as the class implementation takes care of this. This means that for example functions named
XsDevice_<function name>
in the C interface are available in the C++ interface as the
<function name>
method of the
XsDevice
class.
COM interface
For MS Windows environments, all the functionality is also available via a COM interface.
Figure 2: Functionality implementation for specific products