> For the complete documentation index, see [llms.txt](https://nxp.gitbook.io/nxp-cup/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nxp.gitbook.io/nxp-cup/gazebo/milestone-3-simple-reaction/detecting-apriltags-within-simulation.md).

# Detecting AprilTags within simulation

## What's an AprilTag?

An AprilTag is sort of like a QR code, but specifically for robotics. Because our cell phones typically have high resolution cameras, QR codes are quite high resolution. In robotics, camera resolutions are commonly quite low (think 320x240). AprilTags are a type of QR code specifically for low resolution cameras within the robotics space.

![Obstacle 1 in NXP Gazebo](/files/-MhxhQRijQf1jLxfkP_T)

## Why are we using them?

In NXP Gazebo, we use AprilTags to allow participants to detect objects within the simulation without actually writing computer vision code. Each AprilTag has an ID that will be detected by the included AprilTag detection node. All participants have to do is subscribe to the `/apriltag/detections` ROS topic and check to see if an AprilTag has been detected!

## How do I subscribe to the AprilTag detections topic?

We have updated NXP Gazebo's example code to include a section about subscribing to AprilTags. You can find this example code within the "aim\_lin&#x65;*\_*&#x66;ollow\_c.cpp" file. To update your NXP Gazebo, follow the page below:

{% content-ref url="/pages/-MUUnet\_zbeBHghuGgOA" %}
[Updating NXP Gazebo](/nxp-cup/gazebo/updating-nxp-gazebo.md)
{% endcontent-ref %}

## What are the AprilTag IDs?

The IDs for each AprilTag are as follows:

Stop sign: ID 0

Object obstructing road: ID 1


---

# 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, and the optional `goal` query parameter:

```
GET https://nxp.gitbook.io/nxp-cup/gazebo/milestone-3-simple-reaction/detecting-apriltags-within-simulation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
