Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

How to get pose from ArUco or QR Markers?

0 votes
Hello,

I would like to use the camera to help adding  localization and navigation capabilities to a indoor robot. I am using Markers Combo because I can use a mix of markers.

 Is that possible to obtain camera's angle of incidence on the marker?  Knowing from which side and from what angle is looking at the marker it will help determinate on which direction the robot is moving.

Also about  q1,---q4 quaternions  if D3 serstyle or x1,y1 , ...x4,y4 image corners coordinates for D2 serstyle,  is not clear to me which one is where reported to the image center.  I didn't found any clear explanation in the documentation.

Thank you!
asked Oct 11, 2017 in User questions by DT (310 points)

1 Answer

+1 vote

yes, this has not been fully tested here, here are some hints while we investigate here as well:

- only the ArUco and ARtoolkit modules compute the quaternion

- to enable, you do (as it looks like you are doing already):

setpar serstyle Detail

setpar serprec 5

setpar dopose true

- the quaternion can be interpreted as an axis (pointing normal from the marker) and a rotation angle about this axis. Hence you may want to try to convert it to an AngleAxis using the Eigen library if your program is already using it, or check out this link

http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/

- So, in the D3 message, you get

D3 id x y z w h d q1 q2 q3 q4 extra

where x,y,z are the 3D coordinates of the center of the marker (in millimeters)

w,h,d are marker size in millimeters (d is always 1mm, w and h are just as you have declared the markerlen ArUco parameter)

q1 to q4 are the quaternion, if you transform it into Axis-Angle representation, the axis should tilt as you tilt the marker in front of the camera.

I know we need to make a tutorial about this, will do as soon as we find the time... Thanks for your patience in the meantime and please contribute anything you can find while experimenting.

answered Oct 20, 2017 by JeVois (46,580 points)
Hello,
When you feed D3 message to ROS, and  trying to read with RVIZ, it gives a ''illformed quaternion'' error message.
Looking at the code https://github.com/jevois/jevoisbase/blob/master/src/Components/ArUco/ArUco.C#L152  

It seems it is lacking normalisation. I am really not an expert in math but I found some clues on this threads
https://stackoverflow.com/questions/54078932/arcore-pose-and-aruco-estimateposesinglemarkers
...