9#include <unordered_map>
42 kBlueAllianceWallRightSide,
43 kRedAllianceWallRightSide,
63 units::meter_t fieldLength, units::meter_t fieldWidth);
132 std::unordered_map<int, AprilTag> m_apriltags;
133 units::meter_t m_fieldLength;
134 units::meter_t m_fieldWidth;
#define WPILIB_DLLEXPORT
Definition: SymbolExports.h:36
namespace for Niels Lohmann
Definition: json.h:96
Class for representing a layout of AprilTags on a field and reading them from a JSON format.
Definition: AprilTagFieldLayout.h:39
friend WPILIB_DLLEXPORT void to_json(wpi::json &json, const AprilTagFieldLayout &layout)
AprilTagFieldLayout(std::vector< AprilTag > apriltags, units::meter_t fieldLength, units::meter_t fieldWidth)
Construct a new AprilTagFieldLayout from a vector of AprilTag objects.
bool operator==(const AprilTagFieldLayout &) const =default
units::meter_t GetFieldLength() const
Returns the length of the field the layout is representing.
OriginPosition
Definition: AprilTagFieldLayout.h:41
std::optional< Pose3d > GetTagPose(int ID) const
Gets an AprilTag pose by its ID.
void Serialize(std::string_view path)
Serializes an AprilTagFieldLayout to a JSON file.
units::meter_t GetFieldWidth() const
Returns the length of the field the layout is representing.
std::vector< AprilTag > GetTags() const
Returns a vector of all the april tags used in this layout.
friend WPILIB_DLLEXPORT void from_json(const wpi::json &json, AprilTagFieldLayout &layout)
Pose3d GetOrigin() const
Returns the origin used for tag pose transformation.
AprilTagFieldLayout(std::string_view path)
Construct a new AprilTagFieldLayout with values imported from a JSON file.
void SetOrigin(const Pose3d &origin)
Sets the origin for tag pose transformation.
AprilTagFieldLayout()=default
void SetOrigin(OriginPosition origin)
Sets the origin based on a predefined enumeration of coordinate frame origins.
Represents a 3D pose containing translational and rotational elements.
Definition: Pose3d.h:21
basic_string_view< char > string_view
Definition: core.h:501
Definition: AprilTagPoseEstimator.h:15
WPILIB_DLLEXPORT void from_json(const wpi::json &json, AprilTagFieldLayout &layout)
WPILIB_DLLEXPORT void to_json(wpi::json &json, const AprilTagFieldLayout &layout)