I am following the OpenSense - Kinematics with IMU (https://simtk-confluence.stanford.edu:8 ... h+IMU+Data) tutorial/example and in Step Two: Convert IMU Data into OpenSim Format I have to read, and convert, the Xsens IMU sensor data to the OpenSense friendly format, but when I use the following code nothing happens (Python console keeps on running without any output), but when I run the Python script (OpenSense_IMUDataConverter.py) the script works without errors. I concluded that the Python scripting/wrapping is functioning.
The IMU data from the example, for instance, 'MT_012005D6_009-001_00B421E6.txt' has a different format in which the data is organised in the .txt files compared to the IMU data from the relatively new Xsens DOT IMU sensors (I have added a example data file from the these new sensors in this post). I am guessing that the xsens.read() function is not working properly due to the differences in format, but I am not able find the desirable format. Could someone help me with this?
I used the following code in Python (part of the 'OpenSense_IMUDataConverter.py')
Code: Select all
# Import the opensim libraries
import opensim as osim
# Build an Xsens Settings Object.
# Instantiate the Reader Settings Class
xsensSettings = osim.XsensDataReaderSettings('myIMUMappings.xml')
# Instantiate an XsensDataReader
xsens = osim.XsensDataReader(xsensSettings)
# Read in seprate tables of data from the specified IMU file(s)
tables = xsens.read('IMUData/')
# get the trial name from the settings
trial = xsensSettings.get_trial_prefix()
# Get Orientation Data as quaternions
quatTable = xsens.getOrientationsTable(tables)
Furtermore, the advantage of the Xsens DOT IMU sensors is the output of the orientation of the sensor which is already provided in quaternions instead of the classical rotation matrix (3x3 or 1x6). I do not have to convert the rotation matrix to quaternions and therefore the final line of code
Code: Select all
quatTable = xsens.getOrientationsTable(tables)
Hopefully someone is able to help me with these issues!
Ton Leenen