Calculating distance between an Apriltag and Openmv

Discussion related to "under the hood" OpenMV topics.
yashkamble
Posts: 1
Joined: Tue Mar 24, 2020 6:06 am

Calculating distance between an Apriltag and Openmv

Postby yashkamble » Tue Mar 24, 2020 6:23 am

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?
User avatar
kwagyeman
Posts: 4271
Joined: Sun May 24, 2015 2:10 pm

Re: Calculating distance between an Apriltag and Openmv

Postby kwagyeman » Tue Mar 24, 2020 12:11 pm

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.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests