> For the complete documentation index, see [llms.txt](https://campus-rover.gitbook.io/lab-notebook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://campus-rover.gitbook.io/lab-notebook/fiiva/lab-robots/pupper/fiducial-detection.md).

# fiducial-detection.md

![Example of Fiducial Detection](/files/-M_WV662YZ_ypAKcxw_H)

## Raspicam

* We use a RaspberryPi v1 camera whose full documentation can be found at [Raspicam Docs](https://www.raspberrypi.org/documentation/hardware/camera/), this also includes hardware and software specs
* Additional information on how to install Raspicam hardware can be found at [Raspicam Installation](https://thepihut.com/blogs/raspberry-pi-tutorials/16021420-how-to-install-use-the-raspberry-pi-camera)

## AprilTags

* We use the `pupil_apriltags` package to detect fiducials in the Raspicam image so full documentation for the AprilTags can be found at [Pupil AprilTags](https://pypi.org/project/pupil-apriltags/)
* The package works by taking the camera parameters, fiducial size and family, and additional fiducial detection parameters and creating a `detector` class which contains a `detect` method that inputs a camera frame and outputs a list of detected fiducials
* In order to print new apriltags you have to follow the instructions at [AprilTag Generation](https://github.com/AprilRobotics/apriltag-generation) and [Premade AprilTags](https://github.com/AprilRobotics/apriltag-imgs)

## Parameters and Tuning

* The `params.yaml` file contains all of the fiducial vision parameters
* The camera parameters which are used in the `params.yaml` file were found online in the raspicam section
* The size of the fiducial in meters can be adjusted by printing out new fiducials of a larger size

## Transformation Math

* The `src/transforms.py` and `src/geometry.py` contain the methods used for transforming the fiducial detection results into easier to work with translations and rotations
* Also, parameters in `params.yaml` are used to slightly adjust the detection results after transformation

![Fiducial Tag Families](/files/-M_WHp59U42s7rm810cg)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://campus-rover.gitbook.io/lab-notebook/fiiva/lab-robots/pupper/fiducial-detection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
