Angle measurement by Joints Orientations

Hi, I am working on an application where I want to measure the angles of extension, flexion, abduction and adduction.
I do have an Intel real sense D415. I am wondering if anyone knows a way to measure the angles of the arm by just using the joint orientation values. I am thinking measuring with quaternions to euler angles is the way to go, as by doing the scalar factor of 2 vectors some angles and arm variations aren’t taken into consideration.

Hope someone gives me an idea on how I should go on this one.

1 Like

Hello Sergio Morancho!

To determine the bend angle, we need the coordinates of three reference points,
for example, the elbow is necessary to know the position of the joints: elbow, shoulder, and wrist.

To calculate the angle value, you can use the Vector3.Angle method for two vectors:
from the shoulder to the elbow and from the hand to the elbow.

Here is an example of a method for calculating the angle in degrees:

float Angle(nuitrack.Skeleton skeleton, nuitrack.JointType targetJoint, nuitrack.JointType parentJoint, nuitrack.JointType childJoint)
{
	Vector3 targetPosition = skeleton.GetJoint(targetJoint).ToVector3();
	Vector3 parentPosition = skeleton.GetJoint(parentJoint).ToVector3();
	Vector3 childPosition = skeleton.GetJoint(childJoint).ToVector3();

	return Vector3.Angle(parentPosition - targetPosition, childPosition - targetPosition);
}

Let me know if there’s anything else I can do for you.

1 Like