Fiducial markers can function as identifiers for robots, rooms, and objects, as well as serve tasks in augmented reality and 3d mapping.
AprilTags are a visual fiducial system that takes tags created from an ordinary printer. The AprilTag software can compute the 3D position, orientation, and identity of tags relative to the camera’s viewpoint.
This section requires the catkin_ws to be initialized and the turtlebot_dabit package created.
Please click here to learn how to initialize the catkin workspace
Installation should be done on both master and turtlebot computers
sudo apt install libopencv* libcgal-dev libcgal-qt5*cd ~/workspacegit clone -b kinetic-devel https://github.com/dabit-industries/apriltags_cppmkdir apriltags_cpp/buildcd apriltags_cpp/buildcmake ..makesudo make installgit clone -b kinetic-devel https://github.com/dabit-industries/apriltagscd ~/catkin_wscatkin_makeTo generate and print AprilTags, you can convert the postscript to a pdf, or you can use a postscript viewer such as gv.
For this tutorial, we will convert the postscript file to a pdf for printing.
The page number in the .pdf corresponds to the tag ID (eg. page 1 is tag ID 1)
36h11.ps into a pdfcd ~/catkin_ws/src/apriltags/tags/ps2pdf 36h11.ps 36h11.pdfevince ~/catkin_ws/src/apriltags/tags/36h11.pdf1-5
!! This step is not neccesary if you are printing on standard letter paper with the steps above.
With the steps above, the width measurement is 161mm
In order to have accurate tag localization, you need to get the width of the tag in millimeters:

cd ~/catkin_ws/src/turtlebot_dabit/launchgedit fiducial.launch```
source ~/catkin_ws/devel/setup.shroslaunch turtlebot_dabit fiducial.launchYou can view the apriltag detection window on either the turtlebot or master laptop.
source ~/catkin_ws/devel/setup.shrosrun rqt_image_view rqt_image_view image:=/apriltags/detections_imageOn either the turtlebot or master laptop:
source ~/catkin_ws/devel/setup.shrostopic echo /apriltags/detectionsSometimes catkin_make fails. You have to run catkin_make again after it fails.
If you get an error message about ROS MESSAGES, source the catkin_workspace setup: source ~/catkin_ws/devel/setup.sh