11#include "units/length.h"
18template <
class Distance>
19 requires units::length_unit<Distance> || units::angle_unit<Distance>
27 static std::optional<frc::SimpleMotorFeedforward<Distance>>
Unpack(
30 units::unit<std::ratio<1>, units::traits::base_unit_of<Distance>>;
38 units::volt_t{msg.
ks},
39 units::unit_t<typename BaseFeedforward::kv_unit>{msg.
kv},
40 units::unit_t<typename BaseFeedforward::ka_unit>{msg.
ka},
41 units::second_t{msg.
dt},
48 units::unit<std::ratio<1>, units::traits::base_unit_of<Distance>>;
51 .ks = value.
GetKs().value(),
52 .kv = units::unit_t<typename BaseFeedforward::kv_unit>{value.
GetKv()}
54 .ka = units::unit_t<typename BaseFeedforward::ka_unit>{value.
GetKa()}
56 .dt = units::second_t{value.
GetDt()}.value(),
A helper class that computes feedforward voltages for a simple permanent-magnet DC motor.
Definition SimpleMotorFeedforward.h:24
constexpr units::unit_t< ka_unit > GetKa() const
Returns the acceleration gain.
Definition SimpleMotorFeedforward.h:221
constexpr units::volt_t GetKs() const
Returns the static gain.
Definition SimpleMotorFeedforward.h:207
constexpr units::unit_t< kv_unit > GetKv() const
Returns the velocity gain.
Definition SimpleMotorFeedforward.h:214
constexpr units::second_t GetDt() const
Returns the period.
Definition SimpleMotorFeedforward.h:228
Class for wrapping a nanopb ostream.
Definition Protobuf.h:119
bool Encode(const typename Protobuf< std::remove_cvref_t< T > >::MessageStruct &msg)
Decodes a protobuf.
Definition Protobuf.h:211
struct _wpi_proto_ProtobufSimpleMotorFeedforward wpi_proto_ProtobufSimpleMotorFeedforward
Definition SystemServer.h:9
Definition controller.npb.h:53
double kv
Definition controller.npb.h:59
double ks
Definition controller.npb.h:58
double ka
Definition controller.npb.h:60
double dt
Definition controller.npb.h:61
static bool Pack(OutputStream &stream, const frc::SimpleMotorFeedforward< Distance > &value)
Definition SimpleMotorFeedforwardProto.h:45
static std::optional< frc::SimpleMotorFeedforward< Distance > > Unpack(InputStream &stream)
Definition SimpleMotorFeedforwardProto.h:27
Protobuf serialization template.
Definition Protobuf.h:36