WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Rotation2dStruct.hpp
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
10
11template <>
12struct WPILIB_DLLEXPORT wpi::util::Struct<wpi::math::Rotation2d> {
13 static constexpr std::string_view GetTypeName() { return "Rotation2d"; }
14 static constexpr size_t GetSize() { return 8; }
15 static constexpr std::string_view GetSchema() { return "double value"; }
16
17 static wpi::math::Rotation2d Unpack(std::span<const uint8_t> data);
18 static void Pack(std::span<uint8_t> data, const wpi::math::Rotation2d& value);
19};
20
#define WPILIB_DLLEXPORT
Definition SymbolExports.hpp:36
A rotation in a 2D coordinate frame represented by a point on the unit circle (cosine and sine).
Definition Rotation2d.hpp:26
Specifies that a type is capable of raw struct serialization and deserialization.
Definition Struct.hpp:69
Definition CvSource.hpp:15
static constexpr size_t GetSize()
Definition Rotation2dStruct.hpp:14
static void Pack(std::span< uint8_t > data, const wpi::math::Rotation2d &value)
static constexpr std::string_view GetTypeName()
Definition Rotation2dStruct.hpp:13
static constexpr std::string_view GetSchema()
Definition Rotation2dStruct.hpp:15
static wpi::math::Rotation2d Unpack(std::span< const uint8_t > data)
Struct serialization template.
Definition Struct.hpp:39