I need to extract the roll pitch yaw angles from a rotation matrix and I want to be sure that what I do is correct.
Eigen::Matrix< simFloat, 3, 1> rpy = orientation.toRotationMatrix().eulerAngles(0,1,2);
const double r = ((double)rpy(0));
const double p = ((double)rpy(1));
const double y = ((double)rpy(2));
Is that correct? Because I was reading here: http://eigen.tuxfamily.org/dox/group__Geometry__Module.html#gad118fececd448d7485ffea4858775e5a
And I was a bit confused when it says, at the end of the description, in which intervals are defined the angles.
I think this is what you are looking for. Depending on how we use
m.eulerAngles(0, 1, 2)
; Here's the code which get rotx, roty, rotz that is reconstructed withrotx*roty*rotz
Thank you for your reference! I also firstly use Eigen. It's simply save a lot of work!
The answer by Shawn Le is correct but I think the line should be
Then
ea
will hold the yaw pitch and roll value in that order. ZYX euler angle rotation is equivalent to XYZ fixed axis rotation which is nothing but roll pitch and yaw.