raulmur / ORB_SLAM2

Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities
Other
9.46k stars 4.7k forks source link

conversion of rotation matrix to euler angles #766

Open TV-R opened 5 years ago

TV-R commented 5 years ago

I have been working with stereo KITTI dataset and ORB-SLAM2. It is clear that the output trajectory is of the SE(3) format ([R|T]). I want to convert the rotation matrix to euler angles. I noticed in Issue #378 it was mentioned that the order of rotation is x,y,z. I would like to confirm if it is right because I am getting weird results when I convert them.

Please help

thohemp commented 5 years ago

OpenCV provides a function for this: https://github.com/opencv/opencv/blob/master/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/Utils.cpp

cv::Mat rot2euler(const cv::Mat & rotationMatrix)