Hi,
i’m currently struggeling with a certain kinematic problem. This problem occupies me now for almost two days. but I just can’t wrap my head around the math.
The Problem:
I need to apply a transform of an object within Unity to another program (“V-rep”). The interface of this program only allows me to set three euler angles (X-Y’-Z’’ notation) of an object (no quaternion, rotation matrix or angle axis).
More detailed:
In unity, I have a sphere (position and orientation are important) which defines the desired end-frame of a robot arm.
In V-rep, I have another sphere, defining the target position and orientation for some inverse kinematic algorithms.
A manipulation of the sphere in Unity (e.g. rotating it) shall be aplied to the sphere in V-rep.
The difference between the coordinate system is only that Y and Z axis are swapped:
Right: Unity(1,0,0) and V-rep (1,0,0)
Up: Unity(0,1,0) and V-rep (0,0,1)
Forward: Unity(0,0,1) and V-rep(0,1,0)
I tried already several code snippets and pseudo code.
Usually by creating a transformation matrix with the unity quaternion components (w,x,y,z), (modifing this matrix) and afterwards calculating the three euler angles (a,b,c) for the euler angle notation: Rx(a)*Ry’(b)*Rz’'(c)
Mostly are the second and third rotations not correct.
I am, due design limitations, not able to use a workaround on the V-rep side. I really have to use this interface method.
Does anyone have some insightfull hints or maybe even some working code for this problem?
Many thanks in advance, even if only for reading till here!