WPILibC++ 2025.3.2
Loading...
Searching...
No Matches
AprilTag.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <wpi/RawFrame.h>
8#include <wpi/SymbolExports.h>
9#include <wpi/json_fwd.h>
10
11#include "frc/geometry/Pose3d.h"
12
13namespace frc {
14
15/**
16 * Represents an AprilTag's metadata.
17 */
19 /// The tag's ID.
20 int ID;
21
22 /// The tag's pose.
24
25 bool operator==(const AprilTag&) const = default;
26
27 static bool Generate36h11AprilTagImage(wpi::RawFrame* frame, int id);
28 static bool Generate16h5AprilTagImage(wpi::RawFrame* frame, int id);
29};
30
32void to_json(wpi::json& json, const AprilTag& apriltag);
33
35void from_json(const wpi::json& json, AprilTag& apriltag);
36
37} // namespace frc
#define WPILIB_DLLEXPORT
Definition SymbolExports.h:36
namespace for Niels Lohmann
Definition json.h:99
Represents a 3D pose containing translational and rotational elements.
Definition Pose3d.h:28
Definition CAN.h:11
WPILIB_DLLEXPORT void to_json(wpi::json &json, const Rotation3d &rotation)
WPILIB_DLLEXPORT void from_json(const wpi::json &json, Rotation3d &rotation)
Represents an AprilTag's metadata.
Definition AprilTag.h:18
int ID
The tag's ID.
Definition AprilTag.h:20
static bool Generate16h5AprilTagImage(wpi::RawFrame *frame, int id)
Pose3d pose
The tag's pose.
Definition AprilTag.h:23
static bool Generate36h11AprilTagImage(wpi::RawFrame *frame, int id)
bool operator==(const AprilTag &) const =default
Definition RawFrame.h:92