mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpilib] Add AprilTag and AprilTagFieldLayout (#4421)
This is an API for looking up a Pose3d from a tag id, and includes functionality to load that map from a JSON file. This also adds JSON support to Pose3d, Rotation3d. Translation3d, and Quaternion. Co-authored-by: Tyler Veness <calcmogul@gmail.com> Co-authored-by: AMereBagatelle <themerebagatelle@gmail.com>
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
|
||||
#include "frc/EigenCore.h"
|
||||
|
||||
namespace wpi {
|
||||
class json;
|
||||
} // namespace wpi
|
||||
|
||||
namespace frc {
|
||||
|
||||
class WPILIB_DLLEXPORT Quaternion {
|
||||
@@ -92,4 +96,10 @@ class WPILIB_DLLEXPORT Quaternion {
|
||||
Eigen::Vector3d m_v{0.0, 0.0, 0.0};
|
||||
};
|
||||
|
||||
WPILIB_DLLEXPORT
|
||||
void to_json(wpi::json& json, const Quaternion& quaternion);
|
||||
|
||||
WPILIB_DLLEXPORT
|
||||
void from_json(const wpi::json& json, Quaternion& quaternion);
|
||||
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user