Dave Does AprilTags From Far Away

In the ROS world there are different kinds of “visual fiducial systems” - two of the most common supported by OpenCV (Open Computer Vision) are ArUco markers and AprilTags. For years Dave and Carl have had ArUco markers on their docks, with the idea the robots would use the marker to find their dock after wandering off.

Both Dave and Carl can detect the ArUco marker on their docks, but only within limited range.

AprilTags are capable of encoding much more information, but of importance to Dave, are said to be more detectable. Over the last couple days, I managed to figure out how to install the apriltag opencv package and the apriltag_ros wrapper for ROS 2 Humble, and get the node subscribing to the image topic published by Dave’s Oak-D-W camera.

Tonight I tested how far Dave can see a 6 by 6 square AprilTag 150mm on a side. Since the camera has a 150 degree wide angle field of view, the markers are smaller in the image than with Dave’s former Oak-D-Lite camera, but he is still able to detect the marker up close and from 6 meters away!

This is Dave detecting the AprilTag at 0.5 meters:



This is Dave detecting the AprilTag at 6 meters:

For Dave to be able to actually use the detected AprilTag, I have to learn how to calibrate the camera image, and get all the camera position variables accurate to Dave’s mounting.

I learned that the ROS 2 Navigation docking feature only works if the dock contacts are on the same end of the robot as the camera - not Dave’s configuration. I either need to move the contacts to the front, mount the camera in the back, or add a backward facing PiCamera so Dave can have “eyes in the back of his head”.

2 Likes

Figured out the apriltag_ros package publishes a /tf for the detected dock tag, and figured out how to use tf_echo to see the transform (distance from the camera to the dock marker).

pi@GoPi5Go:DOCKER:~/GoPi5Go/ros2ws $ ros2 run tf2_ros tf2_echo oak dock

I haven’t calibrated the camera, so the detection estimates are 20-24% high. No idea what final accuracy will be.

Here the tf shows the dock marker at 68cm, actual was about 55cm:

At time 1734834952.30679414
- Translation: [0.682, 0.046, -0.034]
- Rotation: in Quaternion [-0.493, -0.487, 0.489, 0.530]
- Rotation: in RPY (radian) [-1.532, -0.035, 1.523]
- Rotation: in RPY (degree) [-87.758, -1.980, 87.288]




Here the tf shows the dock marker at 3meters, actually 2.5m:

At time 1734834649.661651584
- Translation: [3.059, -1.605, -0.093]
- Rotation: in Quaternion [-0.425, -0.499, 0.557, 0.511]
- Rotation: in RPY (radian) [-1.429, -0.036, 1.688]
- Rotation: in RPY (degree) [-81.866, -2.076, 96.732]

1 Like

Interesting … New Dock Sign Brings Astounding Accuracy (uncalibrated)

I redid Dave’s dock sign with an AprilTag (125mm Type: 36h11 ID: 05) and ran some tests to see how visible the new sign would be.



Whoa! Not only detected from “about” 4 meters away, the range to the marker was as close as I could measure using a squirrely 7.5 meter tape.

From 2 meters head on, it estimated 2m:

And for the pièce de résistance ??

I’m going to put off calibration until Dave demands a better estimator.

The camera is a big juice hog. With the camera operating and the slight additional computational load of the apriltag_ros node analysing the camera images, Dave is drinking in about 13.5 watts! (Camera draws the extra 5W). At the end of the testing, I checked Dave’s battery - (I had speech volume turned off to not annoy anyone…) Oh boy - 10volts - Dave is in trouble if I don’t get him back on the dock soon!


pi@GoPi5Go:DOCKER:~/GoPi5Go/ros2ws $ ./check_battery.sh 

*** Checking Battery with GoPiGo3 API
GoPiGo3 Battery Voltage: 9.9 volts

*** Checking Battery with ROS2
ros2 topic echo --once /battery_state
header:
  stamp:
    sec: 1734889627
    nanosec: 906025238
  frame_id: base_link
volts: 10.043976783752441
milliamps: 1440.6097412109375
watts: 14.226422309875488
watthours: 12.876992225646973
charging: false
capacity: 24
percent: 0                                                 <<<<------ THIS CANNOT BE GOOD.  0% Battery left
last_charge: 14.737492561340332
last_discharge: 14.377330780029297
---

*** Checking Battery from PiOS
Current Battery 10.00v  0.0% Load: 1427mA 13.5W

==========

2024-12-22 11:49|dave_node.py| ---- GoPi5Go-Dave ROS 2 Undocking, Charge Current 99 mA   12.0v after 1.5 h charging
2024-12-22 12:42|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:42|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:42|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:43|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:43|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.2v after 0.9 h playtime 
2024-12-22 12:43|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:43|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:43|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:44|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:44|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:44|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:44|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:44|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:45|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:45|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:45|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:45|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 0.9 h playtime 
2024-12-22 12:45|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:46|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.1v after 0.9 h playtime 
2024-12-22 12:46|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:46|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:46|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:46|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:47|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:47|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:47|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:47|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:47|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:48|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking : failure at battery 10.0v after 1.0 h playtime 
2024-12-22 12:48|dave_node.py| ---- GoPi5Go-Dave ROS 2 Docking 1339 : success at battery 10.0v after 1.0 h playtime 
2024-12-22 12:48|dave_node.py| ---- Successful docking - odometry reset to {0,0,0,1}

Dodged a bullet this time. Better turn on the audio again.

2 Likes

Yikes!

I have three spare 510Ω SMD resistors for your battery pack if you want. :rofl:

Seriously, if Dave’s going to be doing that kind of heavy current-lifting more often than once a year, not only will you need a new chassis and motors, you’ll need a decent sized gel-cell battery to go with it!

P.S.
It looks like you have at least part of the location part of the equation knocked.  Good find!

2 Likes

?? - That is from the battery, not the red board. The processor “being Dave”, and the redboard sitting still are drawing only 7W at 12v from the battery.

The extra load from the LIDAR 2W, and Camera 5W, come from the battery → Pololu 5v 2A → {LIDAR, Camera} not through the redboard.

It did cut his playtime from over 2 hours to barely 1 hour. I am eventually going to learn how to startup and shutdown the camera and LIDAR programmatically and only fire them up when needed - eventually, so much to learn, while trying to address the straight driving issue.

2 Likes