2

I am currently working on a project where I need to determine whether a robot, with an ArUco marker on top of it, needs to rotate to a certain direction in order for it to point, with its front, towards a particular object, for which its centre point is known. So basically, what I've got is the centre point of the ball and the 4 points of the marker corners.

I'm including an example of what I mean as an image. Note the little arrow drawn on the marker cardboard. It shows the front side of the robot.

Lastly: I have a camera that captures frames, and the program prints out the rotation vector. For some reason, the values are different during every frame, even though I intentionally left the robot at the same position. Could anyone please explain wy that might be?

Thanks a lot.

Example Image

EDIT: I've got the issue with the rotation vector fluctuating sorted; now I just need to figure out how to use the output of that to get the orientation of the robot, that is, in respect to a ball (of which I have its centre point), which apparently is done through the X-axis.

I'm adding another image, which shows the x-axis as red, the y-axis as blue and the z-axis as green. The vectors are of type cv::Vec3d.

First, some code:

std::vector<cv::Vec3d> rvecs, tvecs;
cv::aruco::estimatePoseSingleMarkers(corners, 0.05, CAMERA_MATRIX, DISTORTION_COEFFICIENTS, rvecs, tvecs);

And the image showing what I mean:

Example Rotation

Prefork
  • 43
  • 6
  • Could you include some code? How sure are you that the four points you find are in the right order/orientation, and how are you determining this rotation vector? (I assume rotation vector = angle between direction robot is facing and object it needs to face?) – ELRG Mar 10 '17 at 12:48
  • @ELRG I've added some more details to my original question. – Prefork Mar 20 '17 at 10:32
  • OK, now you've got an x-axis pointing forward from your robot, you need to point this at the ball. I'm not familiar enough with ArUco to give implementation tips, but if you can find a vector from the centre of your robot to the centre of the ball and line up the x-axis vector with this, you'll be pointing at the ball. – ELRG Mar 20 '17 at 13:57

0 Answers0