princeton-vl / DROID-SLAM

BSD 3-Clause "New" or "Revised" License
1.65k stars 272 forks source link

The problem of converting quaternions to rotation matrices #103

Closed Junda24 closed 1 year ago

Junda24 commented 1 year ago

Thank you very much for your excellent work!

I converted the pose in the form of quaternion +translation obtained by frontend in droid slam into a rotation matrix in the following ways, but there were problems with the pose always obtained.

def generate_pose(pose): q = pose[3:].cpu() R = SO3.InitFromVec(q) T_Rotation = R.matrix() translation = pose[:3].cpu() translation[:2] = translation[:2] T_Rotation[:3, 3] = translation return T_Rotation

Is there something wrong with my implementation?