mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpimath] Struct cleanup (#6011)
This commit is contained in:
@@ -11,12 +11,16 @@
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Struct<frc::ArmFeedforward> {
|
||||
static constexpr std::string_view kTypeString = "struct:ArmFeedforward";
|
||||
static constexpr size_t kSize = 32;
|
||||
static constexpr std::string_view kSchema =
|
||||
"double ks;double kg;double kv;double ka";
|
||||
static constexpr std::string_view GetTypeString() {
|
||||
return "struct:ArmFeedforward";
|
||||
}
|
||||
static constexpr size_t GetSize() { return 32; }
|
||||
static constexpr std::string_view GetSchema() {
|
||||
return "double ks;double kg;double kv;double ka";
|
||||
}
|
||||
|
||||
static frc::ArmFeedforward Unpack(std::span<const uint8_t, kSize> data);
|
||||
static void Pack(std::span<uint8_t, kSize> data,
|
||||
const frc::ArmFeedforward& value);
|
||||
static frc::ArmFeedforward Unpack(std::span<const uint8_t> data);
|
||||
static void Pack(std::span<uint8_t> data, const frc::ArmFeedforward& value);
|
||||
};
|
||||
|
||||
static_assert(wpi::StructSerializable<frc::ArmFeedforward>);
|
||||
|
||||
@@ -11,13 +11,18 @@
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Struct<frc::DifferentialDriveWheelVoltages> {
|
||||
static constexpr std::string_view kTypeString =
|
||||
"struct:DifferentialDriveWheelVoltages";
|
||||
static constexpr size_t kSize = 16;
|
||||
static constexpr std::string_view kSchema = "double left;double right";
|
||||
static constexpr std::string_view GetTypeString() {
|
||||
return "struct:DifferentialDriveWheelVoltages";
|
||||
}
|
||||
static constexpr size_t GetSize() { return 16; }
|
||||
static constexpr std::string_view GetSchema() {
|
||||
return "double left;double right";
|
||||
}
|
||||
|
||||
static frc::DifferentialDriveWheelVoltages Unpack(
|
||||
std::span<const uint8_t, kSize> data);
|
||||
static void Pack(std::span<uint8_t, kSize> data,
|
||||
std::span<const uint8_t> data);
|
||||
static void Pack(std::span<uint8_t> data,
|
||||
const frc::DifferentialDriveWheelVoltages& value);
|
||||
};
|
||||
|
||||
static_assert(wpi::StructSerializable<frc::DifferentialDriveWheelVoltages>);
|
||||
|
||||
@@ -11,12 +11,17 @@
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Struct<frc::ElevatorFeedforward> {
|
||||
static constexpr std::string_view kTypeString = "struct:ElevatorFeedforward";
|
||||
static constexpr size_t kSize = 32;
|
||||
static constexpr std::string_view kSchema =
|
||||
"double ks;double kg;double kv;double ka";
|
||||
static constexpr std::string_view GetTypeString() {
|
||||
return "struct:ElevatorFeedforward";
|
||||
}
|
||||
static constexpr size_t GetSize() { return 32; }
|
||||
static constexpr std::string_view GetSchema() {
|
||||
return "double ks;double kg;double kv;double ka";
|
||||
}
|
||||
|
||||
static frc::ElevatorFeedforward Unpack(std::span<const uint8_t, kSize> data);
|
||||
static void Pack(std::span<uint8_t, kSize> data,
|
||||
static frc::ElevatorFeedforward Unpack(std::span<const uint8_t> data);
|
||||
static void Pack(std::span<uint8_t> data,
|
||||
const frc::ElevatorFeedforward& value);
|
||||
};
|
||||
|
||||
static_assert(wpi::StructSerializable<frc::ElevatorFeedforward>);
|
||||
|
||||
Reference in New Issue
Block a user