// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. #include "wpi/math/geometry/struct/Pose2dStruct.hpp" namespace { constexpr size_t kTranslationOff = 0; constexpr size_t kRotationOff = kTranslationOff + wpi::GetStructSize(); } // namespace using StructType = wpi::Struct; frc::Pose2d StructType::Unpack(std::span data) { return frc::Pose2d{ wpi::UnpackStruct(data), wpi::UnpackStruct(data), }; } void StructType::Pack(std::span data, const frc::Pose2d& value) { wpi::PackStruct(data, value.Translation()); wpi::PackStruct(data, value.Rotation()); }