Using body kinematics analysis to calculate orientation error between bodies
Posted: Wed Dec 13, 2023 12:58 pm
Hi!
I've been trying to calculate the orientation error (in degrees along each rotation axis X/Y/Z) between the bodies of 2 models. One model was defined using medical images in a specific 3D pose, while the other model is simulated to that pose. The validation model was defined before and in it's neutral pose the coordinates are all zero, the testing model is identical to the validation model, but it's neutral pose is different from the pose of the validation model (and in its neutral pose the coordinates are zero). I ran inverse kinematics using different settings for the test model (coupling constraints and marker weights on the spine) and I would like to calculate the errors in body locations and orientations. So I ran the body kinematics analysis, calculating the error in body position is not an issue using the outputs from the analysis, however, the orientation is not working out. The issue is in the XYZ body-fixed Euler rotations that are reported as an output from the analysis. The difference in XYZ body-fixed Euler angles does not give any relevant information on the difference in XYZ orientation between the bodies. For example, the difference in Euler angles can be up to 30 degrees along certain axes, while the orientation of both bodies is very similar (i.e. there should only be a few degrees difference). I have been trying to write a code to convert the Euler angles to rotation matrices and find the absolute rotation differences, however, without any success.
So I was wondering whether anyone has a suggestion on how to get relevant orientation differences of the bodies out? Or if someone could explain in detail how the XYZ Euler rotations are defined in OpenSim, I would be very grateful!
I've been trying to calculate the orientation error (in degrees along each rotation axis X/Y/Z) between the bodies of 2 models. One model was defined using medical images in a specific 3D pose, while the other model is simulated to that pose. The validation model was defined before and in it's neutral pose the coordinates are all zero, the testing model is identical to the validation model, but it's neutral pose is different from the pose of the validation model (and in its neutral pose the coordinates are zero). I ran inverse kinematics using different settings for the test model (coupling constraints and marker weights on the spine) and I would like to calculate the errors in body locations and orientations. So I ran the body kinematics analysis, calculating the error in body position is not an issue using the outputs from the analysis, however, the orientation is not working out. The issue is in the XYZ body-fixed Euler rotations that are reported as an output from the analysis. The difference in XYZ body-fixed Euler angles does not give any relevant information on the difference in XYZ orientation between the bodies. For example, the difference in Euler angles can be up to 30 degrees along certain axes, while the orientation of both bodies is very similar (i.e. there should only be a few degrees difference). I have been trying to write a code to convert the Euler angles to rotation matrices and find the absolute rotation differences, however, without any success.
So I was wondering whether anyone has a suggestion on how to get relevant orientation differences of the bodies out? Or if someone could explain in detail how the XYZ Euler rotations are defined in OpenSim, I would be very grateful!