Search code examples
pythontransformationroseuler-angles

3D Rotation of a pose around origin


I want to transform a pose around origin. The pose I have contains a position [x,y,z] and an orientation [x,y,z,w] represented as a quaternion. I have a 4x4 transformation matrix which I use to translate and rotate the position of the pose around origin.

np.dot(transforma_mat, np.transpose(np.append(pose.position, 1)))

So, as the origin moves and rotates, the starting point of the pose also moves and rotates. However, I am not sure how I can rotate the orientation of the pose.

I can convert the quaternion to Euler angles and rotation matrix (and vice versa) using this library.

The story: There is an object which moves and rotates. The robot end-effector has a pose before the object moves and rotates. I want to update the pose of the end-effector such that it moves and rotates with the object.


Solution

  • The general way to translate an object with respect to another object's movement can be found here.

    Try to convert the rotations to matrices. Euler angles didn't work for me.