Open 1234562123 opened 3 years ago
You can get the quaternions of a joint:
# Find Joint Quaternions of Wrist Right
qx = body.joint_orientations[PyKinectV2. JointType_HandRight].Orientation.x
qy = body.joint_orientations[PyKinectV2. JointType_HandRight].Orientation.y
qz = body.joint_orientations[PyKinectV2. JointType_HandRight].Orientation.z
qw = body.joint_orientations[PyKinectV2. JointType_HandRight].Orientation.w
where body is kinect.get_last_body_frame().bodies[bodyID]
and then you can use the transformations library to get the euler angles:
import transformations
(roll, pitch, yaw) = transformations.euler_from_quaternion([qx, qy, qz, qw])
I can currently get the 3D coordinates of the hand by following code Self. X = joints [PyKinectV2. JointType_HandRight] Position. X Self. Y = joints [PyKinectV2. JointType_HandRight] Position. Y self.z = joints[PyKinectV2.JointType_HandRight].Position.z But I also want to get the attitude of the hand joint and the Euler Angle, how do I code it?