control the joints using quaternion or rotation matrix.

Typically: "How do I... ", "How can I... " questions
Post Reply
SitStudent
Posts: 23
Joined: 05 May 2020, 12:07

control the joints using quaternion or rotation matrix.

Post 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 ?

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: control the joints using quaternion or rotation matrix.

Post 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)

Post Reply