16template <
class Distance>
17 requires units::length_unit<Distance> || units::angle_unit<Distance>
20 return "SimpleMotorFeedforward";
22 static constexpr size_t GetSize() {
return 32; }
24 return "double ks;double kv;double ka;double dt";
28 std::span<const uint8_t> data) {
32 constexpr size_t kKsOff = 0;
33 constexpr size_t kKvOff = kKsOff + 8;
34 constexpr size_t kKaOff = kKvOff + 8;
35 constexpr size_t kDtOff = kKaOff + 8;
44 static void Pack(std::span<uint8_t> data,
49 constexpr size_t kKsOff = 0;
50 constexpr size_t kKvOff = kKsOff + 8;
51 constexpr size_t kKaOff = kKvOff + 8;
52 constexpr size_t kDtOff = kKaOff + 8;
A helper class that computes feedforward voltages for a simple permanent-magnet DC motor.
Definition SimpleMotorFeedforward.h:24
Container for values which represent quantities of a given unit.
Definition base.h:1930
constexpr underlying_type value() const noexcept
unit value
Definition base.h:2111
Specifies that a type is capable of raw struct serialization and deserialization.
Definition Struct.h:69
typename units::detail::base_unit_of_impl< U >::type base_unit_of
Trait which returns the base_unit type that a unit is originally derived from.
Definition base.h:936
T UnpackStruct(std::span< const uint8_t > data, const I &... info)
Unpack a serialized struct.
Definition Struct.h:138
void PackStruct(std::span< uint8_t > data, T &&value, const I &... info)
Pack a serialized struct.
Definition Struct.h:200
Type representing an arbitrary unit.
Definition base.h:888
static constexpr std::string_view GetSchema()
Definition SimpleMotorFeedforwardStruct.h:23
static void Pack(std::span< uint8_t > data, const frc::SimpleMotorFeedforward< Distance > &value)
Definition SimpleMotorFeedforwardStruct.h:44
static constexpr std::string_view GetTypeName()
Definition SimpleMotorFeedforwardStruct.h:19
static frc::SimpleMotorFeedforward< Distance > Unpack(std::span< const uint8_t > data)
Definition SimpleMotorFeedforwardStruct.h:27
static constexpr size_t GetSize()
Definition SimpleMotorFeedforwardStruct.h:22
Struct serialization template.
Definition Struct.h:39