Euler Interpretation
- David Walker
- Posts: 13
- Joined: Tue Jun 02, 2009 9:48 pm
Euler Interpretation
Does anyone know how to specify the euler rotation sequence for a Balljoint. It seems pretty straight forward with a customjoint but please verify.
For example. If I had a 3-1-2 sequence and I wanted to represent that in opensim. I would define my spatial transfom axis for each rotation as such rotation 1: about 0 0 1 , rotation 2 : about 1 0 0 and rotation 3: about 0 0 1. I am also asssuming these axis are the body fixed axis. Please verify if this is correct and let me know if there is a way to specify the euler seguence in a BallJoint. Thank you!!!
For example. If I had a 3-1-2 sequence and I wanted to represent that in opensim. I would define my spatial transfom axis for each rotation as such rotation 1: about 0 0 1 , rotation 2 : about 1 0 0 and rotation 3: about 0 0 1. I am also asssuming these axis are the body fixed axis. Please verify if this is correct and let me know if there is a way to specify the euler seguence in a BallJoint. Thank you!!!
- Michael Sherman
- Posts: 807
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Euler Interpretation
Hi, David. The Ball joint uses either a quaternion or 1-2-3 body fixed Euler sequence for generalized coordinates, and angular velocity for generalized speeds. You can't change the sequence. The Gimbal joint (also three rotational dofs) uses the same Euler sequence (never a quaterion), but uses Euler angle derivatives for generalized speeds so that qdot=u for a Gimbal but not for a Ball. (Gimbal is in OpenSim 3.0.1 and later.)
The Custom joint can define an arbitrary body fixed Euler sequence as you figured. In that case the generalized speeds are the Euler angle derivatives. The internals of that joint are discussed in this paper: Seth et al. 2010, Nonlinear Dynamics 62. See section 3, in particular equations 18-20.
Regards,
Sherm
The Custom joint can define an arbitrary body fixed Euler sequence as you figured. In that case the generalized speeds are the Euler angle derivatives. The internals of that joint are discussed in this paper: Seth et al. 2010, Nonlinear Dynamics 62. See section 3, in particular equations 18-20.
Regards,
Sherm
- David Walker
- Posts: 13
- Joined: Tue Jun 02, 2009 9:48 pm
Re: Euler Interpretation
Thanks a bunch Michael this helps a bunch.
best regards
David Walker
best regards
David Walker
- Iman Shirinbayan
- Posts: 7
- Joined: Mon Oct 20, 2014 6:39 am
Re: Euler Interpretation
Hi,
I hope here is the right page to write about my problem.
I know that OpenSim typically uses body fixed (intrinsic) Euler angles. However, in defining a custom joint, it is only possible to define one single specific Euler sequence (for my model, the default order is Z-X-Y). I am able to change it to any other Euler sequence such as X-Y-Z, Z-Y-X and etc (6 possibilities).
My problem is that I need to define the custom joint so that it becomes intrinsic for all six possible Euler sequences simultaneously.
Is it possible?
I hope it is kind of clear.
Regards,
Iman
I hope here is the right page to write about my problem.
I know that OpenSim typically uses body fixed (intrinsic) Euler angles. However, in defining a custom joint, it is only possible to define one single specific Euler sequence (for my model, the default order is Z-X-Y). I am able to change it to any other Euler sequence such as X-Y-Z, Z-Y-X and etc (6 possibilities).
My problem is that I need to define the custom joint so that it becomes intrinsic for all six possible Euler sequences simultaneously.
Is it possible?
I hope it is kind of clear.
Regards,
Iman
- Michael Sherman
- Posts: 807
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Euler Interpretation
Hi, Iman. I think I understand what you are asking (although I still don't understand why). Tell me if this helps:
First, Euler angles are a representation of the relative orientation between two coordinate frames, let's call them A and B. The relative orientation itself is a physical quantity, that is, no matter how you represent it there is still only one relative orientation between A and B. Now you have many, many ways you can represent that quantity. Some possibilities: a 3 x 3 rotation matrix, angle-axis, quaternion, or any one of the 24 possible 2- and 3-axis Euler angle rotation sequences (12 space-fixed [extrinsic] and 12 body-fixed [intrinsic] sequences). All of these numerical choices represent the same physical quantity, that is, the orientation of frame B relative to frame A. Given one of these representations, it is possible to calculate a way to represent the same orientation using any of the other representations.
When performing computations, you must choose one of the numerical representations for orientation. OpenSim's Custom Joint allow you to specify that choice as one of the intrinsic Euler sequences. A joint necessarily makes a single choice about how to represent its motion, that choice is call the joint's "generalized coordinates". When you create a Custom Joint you are saying what you want its generalized coordinates to mean and, if the joint provides rotation, that is a choice of representation for that rotation.
But any representation can express the relative orientation between A and B. Once you have that, you can re-express that orientation any way you like. If you want, you can calculate the orientation's representation in all 6 distinct 3-angle, intrinsic Euler sequences. In fact, if you are writing in C++ OpenSim provides methods in the SimTK::Rotation class that will perform these calculations. See for example convertThreeAxesRotationToThreeAngles().
To summarize: use one representation to determine the relative orientation of B in A, most conveniently as a 3x3 rotation matrix. Then use standard methods to represent that rotation in whatever ways you like.
Regards,
Sherm
First, Euler angles are a representation of the relative orientation between two coordinate frames, let's call them A and B. The relative orientation itself is a physical quantity, that is, no matter how you represent it there is still only one relative orientation between A and B. Now you have many, many ways you can represent that quantity. Some possibilities: a 3 x 3 rotation matrix, angle-axis, quaternion, or any one of the 24 possible 2- and 3-axis Euler angle rotation sequences (12 space-fixed [extrinsic] and 12 body-fixed [intrinsic] sequences). All of these numerical choices represent the same physical quantity, that is, the orientation of frame B relative to frame A. Given one of these representations, it is possible to calculate a way to represent the same orientation using any of the other representations.
When performing computations, you must choose one of the numerical representations for orientation. OpenSim's Custom Joint allow you to specify that choice as one of the intrinsic Euler sequences. A joint necessarily makes a single choice about how to represent its motion, that choice is call the joint's "generalized coordinates". When you create a Custom Joint you are saying what you want its generalized coordinates to mean and, if the joint provides rotation, that is a choice of representation for that rotation.
But any representation can express the relative orientation between A and B. Once you have that, you can re-express that orientation any way you like. If you want, you can calculate the orientation's representation in all 6 distinct 3-angle, intrinsic Euler sequences. In fact, if you are writing in C++ OpenSim provides methods in the SimTK::Rotation class that will perform these calculations. See for example convertThreeAxesRotationToThreeAngles().
To summarize: use one representation to determine the relative orientation of B in A, most conveniently as a 3x3 rotation matrix. Then use standard methods to represent that rotation in whatever ways you like.
Regards,
Sherm
- Iman Shirinbayan
- Posts: 7
- Joined: Mon Oct 20, 2014 6:39 am
Re: Euler Interpretation
Hi Michael,
Thank you for your detailed explanations. I will go through the links you mentioned.
Maybe I am going too far and as you said, I might not need to have more than one rotations sequence.
Let me briefly describe what I am doing with OpenSim.
I am using some sensor (gyroscope) data (angular velocity) to animate a model on OpenSim. Actually, after recording gyro data, first, I integrate over the angular velocity time series to obtain angular displacements.Then, I feed these displacements to OpenSim to animate the model. At this point, I found out that the way my senors work and the way Opensim's model works are inconsistent (I have tried different models so far, they all work the same).
I have attached a picture (model) showing four different arm orientations to make the problem more clear. When I feed gyro data associated with shoulder joint to OpenSim, the model does not follow the real movement as my subject performed. For example, if I mount my 3DoF Gyro on upper arm and then ask my subject to make -90d arm adduction followed by 90d arm flexion, the real arm movement will end up in the last skeletal model's orientation shown on the attached picture (the initial posture is also shown on the picture). However, now, if I feed this gyro data (two successive rotations) to OpenSim, the arm ends up in third orientation of the attached picture.
That's why I thought I might need to change the local frame of shoulder so that it ends up in the desired position.
Regards,
Iman
Thank you for your detailed explanations. I will go through the links you mentioned.
Maybe I am going too far and as you said, I might not need to have more than one rotations sequence.
Let me briefly describe what I am doing with OpenSim.
I am using some sensor (gyroscope) data (angular velocity) to animate a model on OpenSim. Actually, after recording gyro data, first, I integrate over the angular velocity time series to obtain angular displacements.Then, I feed these displacements to OpenSim to animate the model. At this point, I found out that the way my senors work and the way Opensim's model works are inconsistent (I have tried different models so far, they all work the same).
I have attached a picture (model) showing four different arm orientations to make the problem more clear. When I feed gyro data associated with shoulder joint to OpenSim, the model does not follow the real movement as my subject performed. For example, if I mount my 3DoF Gyro on upper arm and then ask my subject to make -90d arm adduction followed by 90d arm flexion, the real arm movement will end up in the last skeletal model's orientation shown on the attached picture (the initial posture is also shown on the picture). However, now, if I feed this gyro data (two successive rotations) to OpenSim, the arm ends up in third orientation of the attached picture.
That's why I thought I might need to change the local frame of shoulder so that it ends up in the desired position.
Regards,
Iman
- Ton van den Bogert
- Posts: 166
- Joined: Thu Apr 27, 2006 11:37 am
Re: Euler Interpretation
Iman,
Euler angles are not simply the integral of the XYZ components of the angular velocity vector.
There is a linear relationship between the time derivatives of the Euler angles and these angular velocity measurements. This relationship is different depending on which Euler sequence you want. You use this to solve for the time derivatives of the Euler angles, integrate those, and then the angles can go into Opensim.
Here is a reference, there's probably a better one, you should search.
http://physics.stackexchange.com/questi ... ler-angles (scroll all the way to the end)
Then there is the separate issue that integration introduces drift. If that is a problem, it is usually solved by using a magnetometer and accelerometer together with the gyro, then these measurements go into a Kalman filter that estimates the 3D orientation of the sensor. I recently read some papers on this by Sabatini that I liked.
Ton van den Bogert
Euler angles are not simply the integral of the XYZ components of the angular velocity vector.
There is a linear relationship between the time derivatives of the Euler angles and these angular velocity measurements. This relationship is different depending on which Euler sequence you want. You use this to solve for the time derivatives of the Euler angles, integrate those, and then the angles can go into Opensim.
Here is a reference, there's probably a better one, you should search.
http://physics.stackexchange.com/questi ... ler-angles (scroll all the way to the end)
Then there is the separate issue that integration introduces drift. If that is a problem, it is usually solved by using a magnetometer and accelerometer together with the gyro, then these measurements go into a Kalman filter that estimates the 3D orientation of the sensor. I recently read some papers on this by Sabatini that I liked.
Ton van den Bogert
- Iman Shirinbayan
- Posts: 7
- Joined: Mon Oct 20, 2014 6:39 am
Re: Euler Interpretation
Hi Tom,
I have read the contents of the link you posted and I think I have to put more time on it. Actually, I did not know about the difference between Euler angles and integration of angular velocity.
Here are two question:
1: I still think maybe it is enough to just use integration of angular velocity to animate a model on OpenSim. Because when I feed a specific rotation data (lets say 90 degrees of elbow flexion), I can see the same rotation on the animated model. Am I wrong here completely?
2: I am also wondering no matter what the nature of my motion file is (integration of angular velocity or Euler angles), I need to change the local coordinate frame of shoulder joint so that it follows all actual rotations happened in reality and measured by my gyroscopes. Regarding the picture I attached in the previous post, do you have any idea how to change the definition of shoulder coordinate or how to feed my data to OpenSim so that the model shows the actual task and ends up in the last position shown on the picture (skeletal model on the right side)?
Regarding gyro cumulative errors, I have solved it using some restrictions imposed on the tasks of my experiment.
Regards,
Iman
I have read the contents of the link you posted and I think I have to put more time on it. Actually, I did not know about the difference between Euler angles and integration of angular velocity.
Here are two question:
1: I still think maybe it is enough to just use integration of angular velocity to animate a model on OpenSim. Because when I feed a specific rotation data (lets say 90 degrees of elbow flexion), I can see the same rotation on the animated model. Am I wrong here completely?
2: I am also wondering no matter what the nature of my motion file is (integration of angular velocity or Euler angles), I need to change the local coordinate frame of shoulder joint so that it follows all actual rotations happened in reality and measured by my gyroscopes. Regarding the picture I attached in the previous post, do you have any idea how to change the definition of shoulder coordinate or how to feed my data to OpenSim so that the model shows the actual task and ends up in the last position shown on the picture (skeletal model on the right side)?
Regarding gyro cumulative errors, I have solved it using some restrictions imposed on the tasks of my experiment.
Regards,
Iman
- Iman Shirinbayan
- Posts: 7
- Joined: Mon Oct 20, 2014 6:39 am
Re: Euler Interpretation
Hi Tom and Michael,
Finally I fixed the problem using the principles you mentioned.
As you said I should have fed Euler angles rather than simple integration of gyro readings.
Thanks a lot for enlightening me!
Iman
Finally I fixed the problem using the principles you mentioned.
As you said I should have fed Euler angles rather than simple integration of gyro readings.
Thanks a lot for enlightening me!
Iman
- Michael Sherman
- Posts: 807
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Euler Interpretation
Great! Glad to hear that, Iman. Congratulations.
Regards,
Sherm
Regards,
Sherm