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 ~/workspace
git clone -b kinetic-devel https://github.com/dabit-industries/apriltags_cpp
mkdir apriltags_cpp/build
cd apriltags_cpp/build
cmake ..
make
sudo make install
git clone -b kinetic-devel https://github.com/dabit-industries/apriltags
cd ~/catkin_ws
catkin_make
To 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.pdf
evince ~/catkin_ws/src/apriltags/tags/36h11.pdf
1-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/launch
gedit fiducial.launch
```
source ~/catkin_ws/devel/setup.sh
roslaunch turtlebot_dabit fiducial.launch
You can view the apriltag detection window on either the turtlebot or master laptop.
source ~/catkin_ws/devel/setup.sh
rosrun rqt_image_view rqt_image_view image:=/apriltags/detections_image
On either the turtlebot or master laptop:
source ~/catkin_ws/devel/setup.sh
rostopic echo /apriltags/detections
Sometimes 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