August 4, 2024
Today, I finished my code for mapping an AprilTag environment. My code consists mainly of two nodes: one to publish detected tags, and the other to calculate the transforms between adjacent tags.
The logic for the broadcaster node goes like this: spin in a circle, broadcast all of the AprilTag frames that are seen by the camera, record all of the current tags seen and the all of the tags seen, and then check when the first tag is seen again to complete the loop.
The logic for the calculator node goes like this: when camera sees two tags at the same time, use the lookup_transform() method to calculate the rotation and translation between the tags, and then append this to a list. In the end, the node would broadcast the frame of the first tag, and then all of the transforms of the adjacent tags, one after the other. In theory, this would create a map that resembles the real environment.
I did some testing with my code. Since my camera's field of view was so small, I needed many tags, so I placed the AprilTags in a decagon arragement. However, when I manually plotted the points, and even when I used rviz, it did not resemble a decagon shape. Instead, it looked more like a line.
Comments
Post a Comment