thomas-haslwanter / scikit-kinematics

Python functions for working with 3D kinematics.
Other
129 stars 45 forks source link

Xens data file doesn't work #44

Open cab938 opened 3 years ago

cab938 commented 3 years ago

I've got binary datafiles from Xens (.mvn) but it seems the code is setup to work with a different kind of file (a .csv?). Maybe the format has changed, or maybe I need to preprocess it first somehow?

mustafa-sarshar commented 3 years ago

no sir, actually it is compatible only with .txt file with skiprows=4 and sep="," If you check the codes, you will find it very straight forward.

thomas-haslwanter commented 3 years ago

As specified in the documentation (http://work.thaslwanter.at/skinematics/html/imus.html):

If you have your own data format, you have to implement the corresponding “get_data” method. You can base it on:

It should be quite straightforward, and I could help if necessary: I would be grateful for any addition to extend the number of sensors supported!

Sorry about the super-slow reply: I have been having health problems, which have slowed me down.

misz11 commented 1 year ago

I have an Xsens IMU and would like to use the package skinematics. However, the Xsens class of yours says the data is generated by: Import data saved with XSens-sensors, through subclassing "IMU_Base".

Where can I find this data generation. With the SDK from the manufacturer, a txt.file is created but not in the desired format of your Xsens class, and therefore does not work. If this doesn't exist, it doesn't make sense from my point of view to make different classes of sensors, if the data is read from txt files anyway and there is no possibility to read the sensors in the right format.

Sorry for my confusion.

thomas-haslwanter commented 1 year ago

I am not sure if I understand your question. If your (new-format) data are in a single file, then

and you should be able to use the new module. Ideally, if it works you would make this a pull request. That would also be great for other users!

Note that you have to have this file in the module where skinematics is found. You can find this by opening Python, and type

import skinematics as skin skin.file

misz11 commented 1 year ago

And how did you record the data from the Xsens IMU? perhaps my implementation of the data recording is faulty.

thomas-haslwanter commented 1 year ago

Can you post the first 10 lines of your data-file?

misz11 commented 1 year ago

Acc X: 0.04, Acc Y: -0.03, Acc Z: 7.35 |Gyr X: 0.00, Gyr Y: -0.01, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.06, Acc Y: -0.03, Acc Z: 9.79 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.05, Acc Y: -0.03, Acc Z: 9.79 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.05, Acc Y: -0.02, Acc Z: 9.80 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.04, Acc Y: -0.03, Acc Z: 9.81 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.04, Acc Y: -0.03, Acc Z: 9.81 |Gyr X: 0.01, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.04, Acc Y: -0.04, Acc Z: 9.79 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.05, Acc Y: -0.03, Acc Z: 9.80 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.05, Acc Y: -0.03, Acc Z: 9.81 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.04, Acc Y: -0.04, Acc Z: 9.80 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.05, Acc Y: -0.04, Acc Z: 9.80 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.05, Acc Y: -0.03, Acc Z: 9.80 |Gyr X: 0.00, Gyr Y: -0.01, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.05, Acc Y: -0.03, Acc Z: 9.79 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24 Acc X: 0.04, Acc Y: -0.03, Acc Z: 9.80 |Gyr X: 0.00, Gyr Y: -0.00, Gyr Z: 0.00 |Mag X: 0.31, Mag Y: 2.29, Mag Z: 0.24

this are my first 10 lines

thomas-haslwanter commented 1 year ago

This looks weird. Is this really the file produce by the XSens recording software? This looks more like data that have already been read in by you!

A Python script to read in the latest version of XSens-sensors can be found here. Please try to figure out (from your XSens-documentation) what format your data-file is, and proceed from there.

misz11 commented 1 year ago

This is the file created by the example python code of the SDK (provided by Xsens/Movella). The data is first read and stored in a log file and with another script this txt file can be created from this log file as shown above.

I have not changed anything in the code.