The AprilTag one is in the same directory as the optical flow one.
I’ve created a wiki page here on ardupilot.org to help users with the setup.
Thanks, I’ll make sure your script is in the next release.
Hi @kwagyeman,
I managed to test the mavlink_apriltags_landing_target.py script and produced a video of it working.
The big issue I found is that the low resolution (QQVGA, 160x120 pixels) means the maximum range is very short (a 30cm x 30cm target can only be seen at less than 3m). To be really useful I think we need to get the range to at least 10m. 20m would be even better. Simply increasing the size of the target doesn’t resolve the problem because then the image becomes too big as the vehicle gets low and the final 50cm of the landing becomes uncontrolled and the vehicle lands off from the center. By the way, I’ve seen some people embed a small AprilTag inside the larger AprilTag but in any case, I think we need to improve the resolution somehow.
While testing I found a few issues that I have fixes for (and will PR):
- The z_to_mm() function which is used to calculate the distance to the target uses tag.z_translation() which seems to return a negative number. We need to reverse the sign so that we send a proper distance.
- The script sends the mavlink distance-sensor message but this isn’t necessary because we are already sending the distance inside the landing-target message. This causes no harm but we can remove 50 lines of code to simplify things.
- The reported angles to the target are off by about 15%. I’m not sure why but I added a “fudge factor” to adjust the scaling to match the values I was seeing.
All feedback more than welcome!
Awesome to see this working! Thanks for testing it. Please send a PR once fixed.
You’ll have to embed April Tags inside of each other to get a higher resolution. This should be possible. You can make one tag the size of a pixel in the tag it’s inside of.
Great thanks. I’m wondering if there is some way to increase the resolution used for AprilTags above the QQVGA resolution? When I tried to compile with QVGA I hit a 64Kb memory limit I think. Maybe the OpenMV CAM H7 has more memory?
The H7 can do 240x240 pixels. This is the absolute max.
Alternatively, you could run the algorithm 4 times on 320x240 with a little overlap per area. It would kinda-of work.