Skip to content

Commit 3cf4886

Browse files
committed
📚 Added documentation about the apriltags to the README
1 parent 3d42c09 commit 3cf4886

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

README.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,44 @@ cmake -DUSE_WHAT_SO_EVER=true ..
112112
cd ..
113113
make
114114
```
115-
The `USE_*` parameters are cached, so they do not have to be passed in each time.
115+
The `USE_*` parameters are cached, so they do not have to be passed in
116+
each time.
117+
118+
### Apriltags Support
119+
120+
There is experimental support for detecting and tracking robots via
121+
[Apriltags](https://april.eecs.umich.edu/software/apriltag). The
122+
standard tag sets in the [Apriltags Imgs
123+
Repo](https://github.com/AprilRobotics/apriltag-imgs) are all
124+
supported along with two customized tag sets:
125+
126+
- Custom20h7: 26 unique tags
127+
128+
To generate the custom tag images you must use the
129+
[Apriltag-Generation
130+
Repo](https://github.com/AprilRobotics/apriltag-generation). Follow
131+
the instructions listed in the repo. The tag layouts are as follows:
132+
133+
- Custom20h7
134+
135+
custom_xxddddxxxwwwwwwxdwbbbbwddwbddbwddwbddbwddwbbbbwdxwwwwwwxxxddddxx
136+
137+
The hamming distance used during generation are as follows:
138+
139+
- Custom20h7: 7
140+
141+
To enable you must set the `USE_APRILTAG` option to `ON`. e.g.:
142+
143+
``` bash
144+
cd build
145+
cmake -DUSE_APRILTAG=ON ..
146+
cd ..
147+
make
148+
```
149+
150+
This will add a new plugin to each camera that runs on every frame. At
151+
the moment the old robot detection patterns are detected in addition
152+
to the apriltag detection.
116153

117154
## Running
118155

@@ -199,3 +236,40 @@ program refuses to start completely when parsing the XML files
199236
(this should normally never occur) then simply delete all
200237
XML files and restart. The program will restore its default
201238
settings.
239+
240+
#### Apriltags
241+
242+
Unlike the butterfly pattern, there are no colors in the apriltags. So
243+
you must manually assign tag ids to the different team colors. Under
244+
Global settings there are two settings list "Blue April Tags" and
245+
"Yellow April Tags". Expand each list and click "Add Tag" to create a
246+
new tag entry for the associated team color. Expand the new entry and
247+
edit the value to a valid tag id in order to begin detection.
248+
249+
You must also configure the apriltag detection settings. The settings
250+
are per camera under the "AprilTag" settings in each thread. Select
251+
the tag family and configure the size in mm of the side of the
252+
Apriltag quad. See the apriltags repository for explanation of the
253+
other options and how they affect detection accuracy and speed.
254+
255+
Apriltag detection takes place on a greyscale version of the image. To
256+
see this image enable "greyscale" un the Visualization plugin for the
257+
appropriate camera. If a tag is not detecting check the greyscale
258+
image contrast. Verify that the tag doesn't have a glare or a large
259+
contrast due to shadows.
260+
261+
Under the Visualization plugin you can also enable the "detected
262+
AprilTags" option. This will draw a cyan border around the quad of the
263+
tag (i.e. the part you should measure and enter as quad size in the
264+
detector settings). It will also draw the tag id in magenta over the
265+
detected tag.
266+
267+
##### Large Distortions
268+
269+
Currently, the tag detection runs on a raw image provided by the
270+
camera to maximize performance. Fixes for distortion happen *AFTER*
271+
detection. However, the apriltag detector is designed to work on
272+
undistorted (aka rectified) images. If your camera lens has a large
273+
distortion (you can see this by the field lines and other image lines
274+
being highly curved), then the detection accuracy may be lower or even
275+
fail.

0 commit comments

Comments
 (0)