[wpimath] Struct cleanup (#6011)

This commit is contained in:
Joseph Eng
2023-12-04 22:40:18 -08:00
committed by GitHub
parent 90757b9e90
commit 14c3ade155
32 changed files with 95 additions and 49 deletions

View File

@@ -11,12 +11,16 @@
template <>
struct WPILIB_DLLEXPORT wpi::Struct<frc::DCMotor> {
static constexpr std::string_view kTypeString = "struct:DCMotor";
static constexpr size_t kSize = 40;
static constexpr std::string_view kSchema =
"double nominal_voltage;double stall_torque;double stall_current;double "
"free_current;double free_speed";
static constexpr std::string_view GetTypeString() { return "struct:DCMotor"; }
static constexpr size_t GetSize() { return 40; }
static constexpr std::string_view GetSchema() {
return "double nominal_voltage;double stall_torque;double "
"stall_current;double "
"free_current;double free_speed";
}
static frc::DCMotor Unpack(std::span<const uint8_t, kSize> data);
static void Pack(std::span<uint8_t, kSize> data, const frc::DCMotor& value);
static frc::DCMotor Unpack(std::span<const uint8_t> data);
static void Pack(std::span<uint8_t> data, const frc::DCMotor& value);
};
static_assert(wpi::StructSerializable<frc::DCMotor>);