qualisys / paf-opensim-example

Example for using OpenSim with the QTM Project Automation Framework
https://www.qualisys.com/software/project-automation-framework/
MIT License
5 stars 2 forks source link

Problem with coordinate system #3

Closed milvus-milvus closed 1 year ago

milvus-milvus commented 1 year ago

Hello, I have been using Qualisys PAF – OpenSim example for some time to calculate the functional muscle-tendon length of our patients'. Unfortunately, I am encountering the following problems. The MoCap data I have comes from the Qualisys system, I use the IOR LB model. After uploading the experimental data to OpenSim everything looks fine. However, when I try to correlate them with the Arnoldetal2010_2Legs_Default_v2.1.osim model (with your instructions), my new model is standing sideways (attached picture). After applying inverse kinematics, the model goes sideways. I suspect that the problem lies in the coordinate system because the experimental data "goes" in the opposite direction than the model, but I don't know how to rotate them 180 degrees. Could I ask for help? Thank you in advance. sideways

AndreyAkse commented 1 year ago

Hello Milvus,

Maybe you could write in more details or provide your example files as well but I was checking Arnoldetal2010_2Legs_Default_v2.1.osim model and it does not use IOR or CAST marker set. Names of the markers are also very different when compared to IOR and CAST. Our Opensim-example contains IOR and CAST marker set models. It does not support Arnoldetal2010_2Legs_Default_v2.1.osim but you can try to research how to modify that so you can use it.

image
AndreyAkse commented 1 year ago

Also, if you go to your project folder and then Templates there is qtm2opensim.py file. If you open it there will be a line (35) where you can rotate marker data. When you process your data in qtm again it will export it with adjusted coordinates.

Rotate marker data

rotate_data_table(markers, [1, 0, 0], -360) # Assumes that z is pointing up vertically in QTM

Just tried to do that and my marker set was also rotated in OpenSim. I hope it can help. image

milvus-milvus commented 1 year ago

Praczko Adrianna_Praczko Adrianna.zip https://drive.google.com/file/d/1MhZ-jWc6GZJ4vlwtzHp5X3N7aGWEtcRz/view?usp=drive_web Hello Andrey! Thank you very much for replying! I will provide more details right away. I use OpenSim to calculate normalized muscle-tendon length during gait cycle. I used the Arnoldetal2010_2Legs_Default_v2.1.osim model instead of yours because yours doesn't have muscles. I changed marker placement and all the names before I used it in simulation. I actually did this simulation for a few patients and it worked, so I have no idea what the problem is. I am sending you my customized model as well as my patient data. In my patient file there are files .mot and .trc acquired during one static and two dynamic trials. From both trials I chose only one step, one for left and one for right leg. After applying inverse kinematics the model is going in the direction of a real trial but like "from side to side". If I can answer any other question please let me know.

Best regards Urszula Kania

sob., 17 cze 2023 o 11:44 AndreyAkse @.***> napisał(a):

Also, if you go to your project folder and then Templates there is qtm2opensim.py file. If you open it there will be a line (35) where you can rotate marker data. When you process your data in qtm again it will export it with adjusted coordinates. Rotate marker data

rotate_data_table(markers, [1, 0, 0], -360) # Assumes that z is pointing up vertically in QTM

Just tried to do that and my marker set was also rotated in OpenSim. I hope it can help. [image: image] https://user-images.githubusercontent.com/120633101/246599801-d0fe1022-acec-4802-94e3-53e6980ae1a7.png

— Reply to this email directly, view it on GitHub https://github.com/qualisys/paf-opensim-example/issues/3#issuecomment-1595693974, or unsubscribe https://github.com/notifications/unsubscribe-auth/ART27XSOS2SVVJ2CHQTRCYDXLV36DANCNFSM6AAAAAAZGNUKC4 . You are receiving this because you authored the thread.Message ID: @.***>

AndreyAkse commented 1 year ago

Hello Ursula,

I was looking at your data but there were no your modified model. I also want to mention that there are muscles in the model examples that are coming with paf opensim example. If you use gait2392_simbody_IOR.osim model then you can go to Forces and there will be Muscles and then all. If you select all and right click mouse press display and Show. They were just hidden but I used recently IOR model and few comparisons in OpenSim to calculate muscle forces, Knee extension and flexion forces.

Best wishes,

Andrey

image image