Create PDF Print

I want to connect to your motion tracker using Matlab, C or visual basic. Do you have an example?


Author:
Xsens Admin
Date added:
Tuesday, 03 March 2009
Last revised:
Thursday, 28 July 2011

Answer

Xsens supplies examples for Matlab, VBA and C/C++ in our MT SDK. Other languages that are able to work with the COM/IDispatch object have the same programming approach as displayed for Matlab and VBA. For languages that do not support the COM/IDispatch object you will have to write a wrapper interface around the CMT dll.

In general you would use the following approach to initiate a measurement: cmtCreateInstance
cmtOpenPort
cmtGotoConfig
//cmtGetMTCount
//cmtGetDeviceId
cmtSetDeviceMode
cmtGotoMeasurement
loop (
 cmtGetNextDataBundle
 cmtDataGet...  // e.g. cmtDataGetOriEuler
)

The device mode includes two variables called mode and settings. The explanation for the bits in mode and settings are given in the MTi user manual in the chapters dealing with the messages. Please look into SetOutputMode and SetOutputSettings if you haven't already done so.

Please note that you have to make sure data is available before you issue cmtGetNextDataBundle, or that you check the result of the cmtGetNextDataBundle function before you use other data functions.

Category

Tags for this item