> 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/apriltags_setup.md).

# How do I set up AprilTags

Setting up apriltags to work with your program is pretty simple.

You can run the following two lines to install apriltags and its ros version onto your ubuntu:

`sudo apt install ros-noetic-apriltag`

`sudo apt install ros-noetic-apriltag-ros`

Afterwards, connect your camera

`roslaunch usb_cam usb_cam-test.launch`

* changed the video\_device to /dev/video2 (or whichever video device you figure out it is) to take from usbcam
* created head\_camera.yaml file from this [example](https://github.com/olinrobotics/usb_cam/blob/master/head_camera.yaml) and added the [calibration](https://www.notion.so/camera-calibration-c7449147443a411f8045b1a434372f3c) information:

```java
cam0:
  camera_model: pinhole
  intrinsics: [684.9223702799867, 686.2362451089259, 307.24291147440965, 257.2964284210188]
  distortion_model: plumb_bob
  distortion_coeffs: [9.39260444e-03, 4.90535732e-01, 1.48962564e-02, 4.68503188e-04, -1.77954077e+00]
  resolution: [640, 480]
  tagtopic: /cam0
```

`roslaunch apriltag_ros continuous_detection.launch publish_tag_detections_image:=true`

* can remap input topics to what you need:
  * image\_rect:=usb\_cam/image\_raw
  * camera\_info:=usb\_cam/camera\_info


---

# 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/apriltags_setup.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.
