Page 1 of 1

control the joints using quaternion or rotation matrix.

Posted: 05 May 2020, 17:35
by SitStudent
Hi, there.

I'm trying to control joints of a mannequin with the euler angle getting from the motion capture.However, I have a problem. In the process of calculating the angle, I have to use "asin". As you know, this range is [pi/2, -pi/2]. In other words, the range of motion of the joints is this range.I want to solve this problem, so I'm thinking of controlling the joints using quaternion or rotation matrix. I know about sim.setObjectMatrix/sim.setObjectquaternion, but this is for the object not joints. I know about sim.setSphericalJointMatrix too, but spherical joint can't be "Moter enabled".

Is there other API or methods to control the joint using quaternion or matrix ?

Re: control the joints using quaternion or rotation matrix.

Posted: 06 May 2020, 11:43
by fferri
A revolute joint has only one degree of freedom, so it doesn't make sense to set a quaternion or a rotation matrix.

Compute your angle using a more robust numerical method (atan2, vector-vector angle, or whatever) and set the joint angle)