# Revision history [back]

### aruco giving strange rotations.

Hi, I am tracking aruco markers in an openCv application. I am using the left frame of a calibrated stereo camera, so the image is undistorted and rectified. As such, i pass 0 parameters to the distortion matrix.

I have the camera pointing down at the floor, and measure the angle with an IMU. The result is 37 degrees in pitch.

I have a marker set up, on the floor, as straight as I can get it in front of the camera.

When I print the rvecs value returned from the marker, I would expect to see something like:

Yaw 0, Roll 0, Pitch -37


but what I do see ( after applying *180 / M_PI;) is:

[131.865, -0.295742, 1.04376]


The rotation is only one axis, which looks right, but the value is a long way off from what it should be. Am I missing something? Or is this as accurate as Aruco gets with a single marker?

As a bonus question.. is it possible to retun quaternions from Aruco tracking?

Thanks!

### aruco giving strange rotations.

Hi, I am tracking aruco markers in an openCv application. I am using the left frame of a calibrated stereo camera, so the image is undistorted and rectified. As such, i pass 0 parameters to the distortion matrix.

I have the camera pointing down at the floor, and measure the angle with an IMU. The result is 37 degrees in pitch.

I have a marker set up, on the floor, as straight as I can get it in front of the camera.

When I print the rvecs value returned from the marker, I would expect to see something like:

Yaw 0, Roll 0, Pitch -37


but what I do see ( after applying *180 / M_PI;) is:

[131.865, -0.295742, 1.04376]


The rotation is only one axis, which looks right, but the value is a long way off from what it should be. Am I missing something? Or is this as accurate as Aruco gets with a single marker?

As a bonus question.. is it possible to retun return quaternions from Aruco tracking?

Thanks!

### aruco giving strange rotations.

Hi, I am tracking aruco markers in an openCv application. I am using the left frame of a calibrated stereo camera, so the image is undistorted and rectified. As such, i pass 0 parameters to the distortion matrix.

I have the camera pointing down at the floor, and measure the angle with an IMU. The result is 37 degrees in pitch.

I have a marker set up, on the floor, as straight as I can get it in front of the camera.

When I print the rvecs value returned from the marker, I would expect to see something like:

Yaw 0, Roll 0, Pitch -37


but what I do see ( after applying *180 / M_PI;) is:

[131.865, -0.295742, 1.04376]


The rotation is only one axis, which looks right, but the value is a long way off from what it should be. Am I missing something? Or is this as accurate as Aruco gets with a single marker?

(the axis displayed in frame looks correct, but the value returned does not)

As a bonus question.. is it possible to return quaternions from Aruco tracking?

Thanks!

### aruco giving strange rotations.

Hi, I am tracking aruco markers in an openCv application. I am using the left frame of a calibrated stereo camera, so the image is undistorted and rectified. As such, i pass 0 parameters to the distortion matrix.

I have the camera pointing down at the floor, and measure the angle with an IMU. The result is 37 degrees in pitch.

I have a marker set up, on the floor, as straight as I can get it in front of the camera.

When I print the rvecs value returned from the marker, I would expect to see something like:

Yaw 0, Roll 0, Pitch -37


but what I do see ( after applying *180 / M_PI;) is:

[131.865, -0.295742, 1.04376]


The rotation is only one axis, which looks right, but the value is a long way off from what it should be. Am I missing something? Or is this as accurate as Aruco gets with a single marker?

(the axis displayed in frame looks correct, but the value returned does not)

As a bonus question.. is it possible to return quaternions from Aruco tracking?

Thanks!

EDIT:

I now have:

cv::Mat expected;
cv::Rodrigues(rvecs[i], expected);

Eigen::Quaterniond mOrientationEigen = convertAr.toQuaternionOg(expected);

Eigen::Quaterniond Convert::toQuaternionOg(const cv::Mat &M)
{
Eigen::Matrix<double, 3, 3> eigMat = toMatrix3d(M);
Eigen::Quaterniond q(eigMat);

return q;
}


But the returned quaternions are garbage. Where am I going wrong here?

### aruco giving strange rotations.

Hi, I am tracking aruco markers in an openCv application. I am using the left frame of a calibrated stereo camera, so the image is undistorted and rectified. As such, i pass 0 parameters to the distortion matrix.

I have the camera pointing down at the floor, and measure the angle with an IMU. The result is 37 degrees in pitch.

I have a marker set up, on the floor, as straight as I can get it in front of the camera.

When I print the rvecs value returned from the marker, I would expect to see something like:

Yaw 0, Roll 0, Pitch -37


but what I do see ( after applying *180 / M_PI;) is:

[131.865, -0.295742, 1.04376]


The rotation is only one axis, which looks right, but the value is a long way off from what it should be. Am I missing something? Or is this as accurate as Aruco gets with a single marker?

(the axis displayed in frame looks correct, but the value returned does not)

As a bonus question.. is it possible to return quaternions from Aruco tracking?

Thanks!

EDIT:

I now have:

cv::Mat expected;
cv::Rodrigues(rvecs[i], expected);

Eigen::Quaterniond mOrientationEigen = convertAr.toQuaternionOg(expected);
toQuaternionOg(expected);

Eigen::Quaterniond Convert::toQuaternionOg(const toQuaternionOg(const cv::Mat &M)
{
Eigen::Matrix<double, 3, 3> eigMat = toMatrix3d(M);
Eigen::Quaterniond q(eigMat);

return q;
}


But the returned quaternions are garbage. Where am I going wrong here?

### aruco giving strange rotations.

Hi, I am tracking aruco markers in an openCv application. I am using the left frame of a calibrated stereo camera, so the image is undistorted and rectified. As such, i pass 0 parameters to the distortion matrix.

I have the camera pointing down at the floor, and measure the angle with an IMU. The result is 37 degrees in pitch.

I have a marker set up, on the floor, as straight as I can get it in front of the camera.

When I print the rvecs value returned from the marker, I would expect to see something like:

Yaw 0, Roll 0, Pitch -37


but what I do see ( after applying *180 / M_PI;) is:

[131.865, -0.295742, 1.04376]


The rotation is only one axis, which looks right, but the value is a long way off from what it should be. Am I missing something? Or is this as accurate as Aruco gets with a single marker?

(the axis displayed in frame looks correct, but the value returned does not)

As a bonus question.. is it possible to return quaternions from Aruco tracking?

Thanks!

EDIT:

I now have:

cv::Mat expected;
cv::Rodrigues(rvecs[i], expected);

Eigen::Quaterniond mOrientationEigen = toQuaternionOg(expected);

Eigen::Quaterniond toQuaternionOg(const cv::Mat &M)
{
Eigen::Matrix<double, 3, 3> eigMat = toMatrix3d(M);
Eigen::Quaterniond q(eigMat);

return q;
}


But the returned quaternions are garbage. garbage: 3.89581e-181.20234e+173.03257e-186.61337e+09

Where am I going wrong here?