Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xens data file doesn't work #44

Open
cab938 opened this issue Apr 21, 2021 · 9 comments
Open

Xens data file doesn't work #44

cab938 opened this issue Apr 21, 2021 · 9 comments

Comments

@cab938
Copy link

cab938 commented Apr 21, 2021

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
Copy link

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
Copy link
Owner

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:

  • “xsens.py” … if all your data are in one file
    
  • “polulu.py” … if you have to manually enter data not stored by your program
    
  • “xio.py” … if your data are stored in multiple files
    

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
Copy link

misz11 commented May 26, 2023

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
Copy link
Owner

thomas-haslwanter commented May 26, 2023

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

  • copy skinematics/sensors/xsens.py to a file xsens_23.py
  • open this file, and modify the method get_data (lines 26-67) so that they work with the new file
  • rename (in xsens_23.py the class XSens to XSens_23

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
Copy link

misz11 commented May 26, 2023

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

@thomas-haslwanter
Copy link
Owner

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

@misz11
Copy link

misz11 commented May 31, 2023

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
Copy link
Owner

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
Copy link

misz11 commented Jun 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants