I was planning to do a comparison between IMUs and optical systems for measuring of segment orientations.
However, I am struggling a bit to get proper segment orientations from the OpenSim GUI.
Here is what I have done so far:
Analyze-> BodyKinematics: Which give me segment orientations in x-y-z euler orientations. However if I try to plot these, two directions are rotating a lot, whereas this is not the case if you play the motion in the GUI.
Am I making a thinking error here?
Segment orientations
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Segment orientations
Body kinematics reports the local frame (position and orientation) of each body as measured in the ground frame.
- Frank Wouda
- Posts: 3
- Joined: Tue Jul 18, 2017 4:48 am
Re: Segment orientations
Thanks for your reply. And yes that is what it should give me indeed. However, if I look at the Euler angles of the pelvis they vary hugely, whereas looking in the GUI the pelvis is more or less stable (treadmill running, so it does make sense).mitkof6 wrote:Body kinematics reports the local frame (position and orientation) of each body as measured in the ground frame.
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Segment orientations
Could you post the figures?
- Frank Wouda
- Posts: 3
- Joined: Tue Jul 18, 2017 4:48 am
Re: Segment orientations
Of course, below I posted the figure. Where x (blue) and z (yellow) euler angles appear to alternate.mitkof6 wrote:Could you post the figures?
http://imgur.com/a/giIEK
- Pagnon David
- Posts: 86
- Joined: Mon Jan 06, 2014 3:13 am
Re: Segment orientations
This is the post I was looking for!
(this one also brings up the issue, as well as this one maybe).
Did anyone figure out why it behaves this way, and how to solve it?
If anyone wants to check it out, I'm attaching the model and the mot file used for BodyKinematics.
The model is just walking on a thin beam, and his pelvis is definitely not rotating this much.
Surprisingly, it randomly works sometimes, maybe when the person is walking towards the x axis? The output from the "Gait10dof18musc" example works fine, for example.
Thanks in advance!
(this one also brings up the issue, as well as this one maybe).
Did anyone figure out why it behaves this way, and how to solve it?
If anyone wants to check it out, I'm attaching the model and the mot file used for BodyKinematics.
The model is just walking on a thin beam, and his pelvis is definitely not rotating this much.
Surprisingly, it randomly works sometimes, maybe when the person is walking towards the x axis? The output from the "Gait10dof18musc" example works fine, for example.
Thanks in advance!
- Attachments
-
- Capture d'écran 2023-09-29 182758.png (47.77 KiB) Viewed 276 times
-
- 0.Model_scaled.osim
- (474.73 KiB) Downloaded 8 times
-
- 0.Balancing.mot
- (105.8 KiB) Downloaded 8 times
Last edited by Pagnon David on Sat Sep 30, 2023 1:23 pm, edited 1 time in total.
- Pagnon David
- Posts: 86
- Joined: Mon Jan 06, 2014 3:13 am
Re: Segment orientations
Potentially related, although I don't think multiplying my orientations by pi/180 solves it.
Radian/degrees confusion in BodyKinematics: https://github.com/opensim-org/opensim-core/issues/2208
(by the way, I use OpenSim 4.4, although I also tried with 4.3 which gives the same results)
Radian/degrees confusion in BodyKinematics: https://github.com/opensim-org/opensim-core/issues/2208
(by the way, I use OpenSim 4.4, although I also tried with 4.3 which gives the same results)
- Pagnon David
- Posts: 86
- Joined: Mon Jan 06, 2014 3:13 am
Re: Segment orientations
Just in case anyone else comes across this issue, I wrote a utility script for obtaining segment locations and orientations from a model and a mot file: https://github.com/perfanalytics/pose2s ... ot_osim.py
It is mostly equivalent to OpenSim Analysis -> BodyKinematics, but without the bugs in orientations (probably due to their use of Euler angles instead of homography matrices).
It builds a .csv file that I can then import in Blender via my Sim2Blend addon. Beware that it transforms to Blender's Z-up convention unless you specify direction='yup' in the script.
Usage:
OR
OR
It is mostly equivalent to OpenSim Analysis -> BodyKinematics, but without the bugs in orientations (probably due to their use of Euler angles instead of homography matrices).
It builds a .csv file that I can then import in Blender via my Sim2Blend addon. Beware that it transforms to Blender's Z-up convention unless you specify direction='yup' in the script.
Usage:
Code: Select all
from Pose2Sim.Utilities import csv_from_mot_osim
csv_from_mot_osim.csv_from_mot_osim_func(r'<input_mot_file>', r'<output_osim_file>', r'<output_csv_file>')
Code: Select all
python -m csv_from_mot_osim -m input_mot_file -o input_osim_file
Code: Select all
python -m csv_from_mot_osim -m input_mot_file -o input_osim_file -c output_csv_file