Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Computing attitude(roll, pitch & yaw) from solvePnP()

I am using solvePnP() to compute for attitude(roll, pitch & yaw). From solvePnP() I got the rotation vector and I use this to accordingly get roll, pitch and yaw. But the problem is when I rotate the camera 45deg, the measurement gives 25deg.

I think, it might be that I need to integrate the angle value(each roll, pitch & yaw ) over time..am I right, integrating it will resolve the issue?

Thanks in advance.

Computing attitude(roll, pitch & yaw) from solvePnP()

I am using solvePnP() to compute for attitude(roll, pitch & yaw). From solvePnP() I got the rotation vector and I use this to accordingly get roll, pitch and yaw. But the problem is when I rotate the camera 45deg, the measurement gives 25deg.

I think, it might be that I need to integrate the angle value(each roll, pitch & yaw ) over time..am I right, integrating it will resolve the issue?

Thanks in advance.

EDIT

The code snippet:

pose[3] = -rot_vec.at(0);

pose[4] = -rot_vec.at(1);

pose[5] = -rot_vec.at(2);

Note: pose[] is roll, pitch & yaw respectively & rot_vec is raw value of rotation vector obtained from solvePnP()