7#include <frc/motorcontrol/MotorController.h>
9#include "rmb/motorcontrol/AngularVelocityController.h"
10#include "rmb/motorcontrol/feedforward/Feedforward.h"
26 std::unique_ptr<frc::MotorController> &&motorController,
28 : motorController(std::move(motorController)),
29 feedforward(std::move(feedforward)) {}
37 targetVelocity = std::clamp(velocity, -maxVelocity, maxVelocity);
38 motorController->SetVoltage(feedforward->calculate(targetVelocity));
47 return targetVelocity;
70 motorController->SetInverted(isInverted);
84 targetVelocity = 0.0_rpm;
85 motorController->Disable();
92 targetVelocity = 0.0_rpm;
93 motorController->StopMotor();
97 std::unique_ptr<frc::MotorController> motorController;
98 std::unique_ptr<rmb::Feedforward<units::radians>> feedforward;
99 units::radians_per_second_t targetVelocity = 0.0_rpm;
100 units::radians_per_second_t maxVelocity =
101 units::radians_per_second_t(std::numeric_limits<double>::infinity());
Definition AngularFeedforwardController.h:20
units::radians_per_second_t getTargetVelocity() const
Definition AngularFeedforwardController.h:46
bool getInverted() const
Definition AngularFeedforwardController.h:78
void disable()
Definition AngularFeedforwardController.h:83
void setMaxVelocity(units::radians_per_second_t max)
Definition AngularFeedforwardController.h:55
units::radians_per_second_t getMaxVelocity() const
Definition AngularFeedforwardController.h:62
void setVelocity(units::radians_per_second_t velocity)
Definition AngularFeedforwardController.h:36
void setInverted(bool isInverted)
Definition AngularFeedforwardController.h:69
void stop()
Definition AngularFeedforwardController.h:91
Definition AngularVelocityController.h:19
Definition Feedforward.h:15
the master namespace of librmb
Definition LogitechGamepad.h:9