[wpimath] Add remaining struct and protobuf implementations (#5953)

This commit is contained in:
Joseph Eng
2024-07-29 07:55:44 -07:00
committed by GitHub
parent 3e1e3fb4ca
commit 073192d513
112 changed files with 3989 additions and 45 deletions

View File

@@ -114,3 +114,6 @@ class WPILIB_DLLEXPORT CubicHermiteSpline : public Spline<3> {
}
};
} // namespace frc
#include "frc/spline/proto/CubicHermiteSplineProto.h"
#include "frc/spline/struct/CubicHermiteSplineStruct.h"

View File

@@ -124,3 +124,6 @@ class WPILIB_DLLEXPORT QuinticHermiteSpline : public Spline<5> {
}
};
} // namespace frc
#include "frc/spline/proto/QuinticHermiteSplineProto.h"
#include "frc/spline/struct/QuinticHermiteSplineStruct.h"

View File

@@ -0,0 +1,18 @@
// 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.
#pragma once
#include <wpi/SymbolExports.h>
#include <wpi/protobuf/Protobuf.h>
#include "frc/spline/CubicHermiteSpline.h"
template <>
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::CubicHermiteSpline> {
static google::protobuf::Message* New(google::protobuf::Arena* arena);
static frc::CubicHermiteSpline Unpack(const google::protobuf::Message& msg);
static void Pack(google::protobuf::Message* msg,
const frc::CubicHermiteSpline& value);
};

View File

@@ -0,0 +1,18 @@
// 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.
#pragma once
#include <wpi/SymbolExports.h>
#include <wpi/protobuf/Protobuf.h>
#include "frc/spline/QuinticHermiteSpline.h"
template <>
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::QuinticHermiteSpline> {
static google::protobuf::Message* New(google::protobuf::Arena* arena);
static frc::QuinticHermiteSpline Unpack(const google::protobuf::Message& msg);
static void Pack(google::protobuf::Message* msg,
const frc::QuinticHermiteSpline& value);
};

View File

@@ -0,0 +1,28 @@
// 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.
#pragma once
#include <wpi/SymbolExports.h>
#include <wpi/struct/Struct.h>
#include "frc/spline/CubicHermiteSpline.h"
template <>
struct WPILIB_DLLEXPORT wpi::Struct<frc::CubicHermiteSpline> {
static constexpr std::string_view GetTypeName() {
return "CubicHermiteSpline";
}
static constexpr size_t GetSize() { return 4 * 2 * 8; }
static constexpr std::string_view GetSchema() {
return "double xInitial[2];double xFinal[2];double yInitial[2];double "
"yFinal[2]";
}
static frc::CubicHermiteSpline Unpack(std::span<const uint8_t> data);
static void Pack(std::span<uint8_t> data,
const frc::CubicHermiteSpline& value);
};
static_assert(wpi::StructSerializable<frc::CubicHermiteSpline>);

View File

@@ -0,0 +1,28 @@
// 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.
#pragma once
#include <wpi/SymbolExports.h>
#include <wpi/struct/Struct.h>
#include "frc/spline/QuinticHermiteSpline.h"
template <>
struct WPILIB_DLLEXPORT wpi::Struct<frc::QuinticHermiteSpline> {
static constexpr std::string_view GetTypeName() {
return "QuinticHermiteSpline";
}
static constexpr size_t GetSize() { return 4 * 3 * 8; }
static constexpr std::string_view GetSchema() {
return "double xInitial[3];double xFinal[3];double yInitial[3];double "
"yFinal[3]";
}
static frc::QuinticHermiteSpline Unpack(std::span<const uint8_t> data);
static void Pack(std::span<uint8_t> data,
const frc::QuinticHermiteSpline& value);
};
static_assert(wpi::StructSerializable<frc::QuinticHermiteSpline>);