Calculating distance between an Apriltag and Openmv

Hi, I seem to be having trouble estimating the distance between an Apriltag (of a fixed size) and the Openmv cam. Is there any way I can do this? Also, my project requires me to detect objects and calculate distances between those objects and the Openmv cam. I have chosen the object to be Apriltag. Can it be done more efficiently with other objects like coloured circles or QR codes?

The Apriltags tells you the distance to it. See the x/y/z_translation() methods on the tag object. As mentioned in the documentation the units are returned without much meaning. If you want them to mean something you have to use the Apriltags 6dof 3d tag example I’m the IDE which explains how you pass a camera information to the method so that the distance to tags are scaled correctly.

For another example see the mavlink April tag example. This show off exactly how to get the distance to a tag.