OpenSense XSens text files

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Amy Silder
Posts: 3
Joined: Thu Oct 06, 2005 11:52 am

OpenSense XSens text files

Post by Amy Silder » Tue Apr 14, 2020 12:53 pm

I am writing a matlab script to convert a single *.mvnx file (from Xsens) into individual text files that I will use as inputs into OpenSens. In the example text files provided in "...\Resources\Code\Matlab\OpenSenseExample\IMUData" there are column headers labeled as:

Mat[1][1] Mat[2][1] Mat[3][1] Mat[1][2] Mat[2][2] Mat[3][2] Mat[1][3] Mat[2][3] Mat[3][3]

What values do these represent?

Thank you!

Tags:

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: OpenSense XSens text files

Post by Ayman Habib » Tue Apr 14, 2020 1:17 pm

Hello Amy,

XSens allows for exporting data as .txt files, going this route you can use OpenSense directly and not parse their .mvnx files. Regardless, the files contain orientation data ( 3x3 rotation matrices), the header specifies which matrix entry is represented by the corresponding data column.

If you end up parsing .mvnx files, you may want to consider sharing that with the community to avoid the community reinventing the wheel.

Please let us know if you have any further questions or feedback using OpenSense.

Best regards,
-Ayman

User avatar
Giacomo Di Raimondo
Posts: 9
Joined: Thu Oct 01, 2015 1:51 pm

Re: OpenSense XSens text files

Post by Giacomo Di Raimondo » Thu May 14, 2020 2:10 am

Hi Ayman,
I tried to convert mvnx format in txt to verify that there are no differences between the segment orientation already calculated with Xsens (in the mvnx file) and the sensor orientation in txt format. But for now, I found completely different results.
Is it possible to convert MNVX (sensor orientations) in TXT ?
Is there an Xsens tool that does it?

Best,
Giacomo

User avatar
Amy Silder
Posts: 3
Joined: Thu Oct 06, 2005 11:52 am

Re: OpenSense XSens text files

Post by Amy Silder » Thu May 14, 2020 6:37 am

First, thank you for your help a while back Ayman! I forgot to reply.

Giacomo,

I tried this a while back, but I am no longer taking this approach. I attached are two m-files, renamed text files so they can be uploaded. First is a program I wrote that is loosely based off an m-file that you can download from XSense on their Base Support website. Second is to write a storage file containing quaterions, using Xsens Dots. Below is what I learned and why I do not think it is best to create a text file from the segment information listed in the *.mvnx file.

- When creating your *.mvnx file, be sure you are exporting the sensor quaterions, not the segment quaternions. I'm almost certain they are different, in part because the MVN software has already created a constrained model for you to use. These are the orientations of the segments in that model, not of the sensors themselves. I believe MVN Analyze will export the sensor quaternions if you check the correct box upon export, so this is what you would want to do. I did not have that software license, so I never tried this approach.
- The *.mvnx files do not contain the t-pose information. You'll have to collect this as a separate trial. In my code, I tried to get around this by averaging the first few seconds of data.

If you are able to get the sensor quaterions, then ask yourself if you really need to convert the quaterions to a rotation matrix, then have OpenSense convert them back? Just write the storage file directly! I never did this, because 1) I don't have sensor orientations and 2) I don't have t-pose information.

What I'm doing now: We are all still working from home and I don't have the xsens system here. Rather, I was able get a set of xsens dots and bring the home. I have successfully written the Xsense Dot quaterions into storage files, calibrated a model in OpenSense, and can track kinematics of me walking and biking around my neighborhood. It's pretty cool!

It's neat once you get it working. Good luck!
Amy
Attachments
Dots2sto.txt
(4.19 KiB) Downloaded 60 times
mvnx2text.txt
(4.34 KiB) Downloaded 52 times

User avatar
Giacomo Di Raimondo
Posts: 9
Joined: Thu Oct 01, 2015 1:51 pm

Re: OpenSense XSens text files

Post by Giacomo Di Raimondo » Fri May 15, 2020 3:19 am

Hi Amy,

Thanks for your help.

I completely agree. I was working with the segment quaternions but I had problems, the calibration results in a parallel configuration of the sensors inside the OpenSim model without any sense. Now, you confirmed what I thought: the segment orientation is different from the sensors one in the mvnx file. Then, if you use directly the sensor quaternion should be correct. Asap I have the possibilities to use the Xsens system I'll try it.

I tried your mvnx2text.m script and it works, thanks. The problem is that, as you said, with the segments quaternions in txt format the results are without any sense.

Unfortunately, I also can't have access to an Xsens device at this very moment. But, it is good to know what was the problem.

Thanks!

Giacomo

User avatar
krishna raj
Posts: 21
Joined: Thu Dec 01, 2022 7:40 am

Re: OpenSense XSens text files

Post by krishna raj » Wed May 24, 2023 4:17 am

Hi Kindly help on this

I have been working on OpenSim to get the ik_mot

as following the tutorials on imu placement and imu inverse kinetics for inputs into OpenSens
It instructed us to use the orientation file as input
for getting the orientation output, I have to use the raw imu data(accelerometer x,y,z and rotational matrix/quaternions)

the problem is the raw imu data file from the client I received got the below parameters alone

1. (accelerometer x,y,z[6 muscles][Unit-1500 G & Volts/each]-18 columns(6*3 x,y,z),
2. RMS[6 muscles][Units-Volts]-6 columns,
3. EMG[6 muscles][Units-5.500 mVolts/each]-6 columns,
4. FORCE[1000.0 mV]-one column
5. Time -One column

how can I generate the orientation file without the quaternions parameters?

finally, how can I get the ik_mot file output?

attached the client raw input imu file
Capture.PNG
Capture.PNG (131.45 KiB) Viewed 499 times

POST REPLY