Resources | Movella

Xsens’ Open Source XDA: Interfacing with a Motion Tracker has never been easier

Written by Xsens | Sep 27, 2019 12:23:00 PM

In a drone’s camera stabilizer or an agricultural robot’s navigation system, Xsens MTi inertial motion tracking modules provide ultra-accurate and stable measurements of acceleration, heading and orientation.

These data outputs are only able to do useful work, however, once they are fed to the host application, where they can be used in the system controlling the drone camera’s gimbal motors or steering the robot’s wheels.

And the glue that bonds an Xsens module to the host is an application programming interface (API) called XDA (Xsens Device API). Now Xsens has introduced a major update of XDA: its most important change is to make the XDA an open-source software module, allowing users to see how it operates and to compile, modify and extend it themselves.

So how does this change affect users of Xsens motion trackers?

A brief history of XDA

XDA was originally created in 2003, in C/C++, to provide a simple and convenient way to communicate with the two (only two then!) motion tracker modules in the Xsens product line-up.

Fast-forward to the present day, and Xsens has six series of motion-tracking products, and each series includes multiple modules. These accelerometer/magnetometer/gyroscope devices are supported by sensor fusion algorithms which are much more sophisticated than the simpler firmware that Xsens provided in 2003.

So there are many more configuration options for the user to choose from than there were in the past, and many more streams of data to be transferred between the module and the host.

This means that a far more capable API is required. It also needs to reflect the environment in which today’s users operate: many developers work in C/C++, but not all do. Many users are developing applications to run on a PC, but some use embedded computing platforms.

Today’s XDA is already a world away from the original 2003 version. The newer features of today’s XDA that developers tell us they love include:

  • Wrappers around the C/C++ interface which enable users to work with XDA in other languages such as MatLab, Python and C#
  • Numerous abstractions which have made the architecture more scalable
  • A richer feature set which provides all the main functions that users require, including configuration of data types, baud rate and hardware operations

Multi-platform support

The latest change to XDA, opening up the code to users, is particularly important to those who do not develop applications for a PC platform. XDA has always natively supported the platforms that most users most commonly use: the Windows® and Linux® operating systems running on a PC.

Apart from the PC, however, there are a multitude of embedded platforms in hundreds of variants. Among the best known and most popular embedded platforms for Xsens users today are Raspberry Pi, BeagleBoard and ODROID.

Xsens cannot supply an XDA variant to support every one of these platforms – but what we can do is to enable our customers to compile XDA themselves to any chosen platform, as long as it is running a Linux or Windows OS.

And that is what we have accomplished by opening up XDA. This move has several benefits, the most important of which is that it enables the developer to compile the API on any platform that she or he chooses. In pre-release testing, our software development team at Xsens ported the new open-source XDA to a Raspberry Pi board running a Linux OS. The port was easy to do, and after compiling, XDA worked perfectly on an MTi 1-series module communicating with the Raspberry Pi board via the XBus protocol.

The new open XDA also enables users to:

  • Add their own extensions to the API, and to modify it
  • See what is going on inside the API, and follow the communication flow between a motion tracker module and a host processor.

Because XDA is no longer a black box, developers can more productively debug and troubleshoot. Before, a developer who encountered a problem in their application involving an MTi module often had to log the issue with the Xsens technical support team. Now, developers can see where the problem occurs and, in many cases, solve it themselves without recourse to Xsens. Even if technical support is required, a solution will often be easier to arrive at because the user is able to provide Xsens with a detailed log of the problem, helping Xsens’ engineers to locate and diagnose it more quickly than when they were working blind.

Open to the future

So XDA has entered a new era, opening up to users and providing free access to the source code. We hope that you like the new open XDA, and welcome your comments and suggestions for further improvements.