2
$\begingroup$

I have managed to receive camera_pose for ORB-SLAM by following their code.

If I run

$ echo /world /camera_pose

I receive something like this:

Translation [-0.8, 0.66, -0.04]

Rotation in Quaternion [ 0.2, -0.3, -0.2, 0.2]

         in RPY radian: [0.071, -0.032, -0.34]

         in RPY degree [0.4, -25.09, -3.2]

Does this mean these are the translations and rotations of the camera_pose compared to the world coordinates?

How do I retrieve the estimate of the camera_pose in global coordinates (I want x,y,z,yaw,pitch, roll)?

$\endgroup$
-1
$\begingroup$

If you need to transform quaternion to euler angels you just need to use this equation:

def quaternion_to_euler(q):

    (x, y, z, w) = (q[0], q[1], q[2], q[3])
    t0 = +2.0 * (w * x + y * z)
    t1 = +1.0 - 2.0 * (x * x + y * y)
    roll = math.atan2(t0, t1)
    t2 = +2.0 * (w * y - z * x)
    t2 = +1.0 if t2 > +1.0 else t2
    t2 = -1.0 if t2 < -1.0 else t2
    pitch = math.asin(t2)
    t3 = +2.0 * (w * z + x * y)
    t4 = +1.0 - 2.0 * (y * y + z * z)
    yaw = math.atan2(t3, t4)
    return [yaw, pitch, roll]

I think translations are already in global coordinates.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.