How to get an rvec replacement from quaternion or euler values

asked 2020-11-16 09:42:46 -0500

Hey, I am using an ArUcolib but want to replace a rvec form solvePnP with data from precise IMU. I get that rvec is a compact Rodrigues notation and theta = sqrt(a^2 + b^2 + c^2) v = rod2/theta = [a/theta, b/theta, c/theta] but cannot find a solution for my problem.

How to convert quaternion or Euler angles to a rotation vector that can replace a rvec?

edit retag flag offensive close merge delete



Easiest thing is to use the Eigen library to handle these kind of conversions. Look at Eigen::AngleAxisd and Eigen::Quaterniond classes.

Otherwise, look at this: Quaternion to AxisAngle

Eduardo gravatar imageEduardo ( 2020-11-16 10:55:59 -0500 )edit