5#include "rmb/motorcontrol/AngularVelocityController.h"
7#include "TalonFXPositionController.h"
8#include "units/angular_velocity.h"
10#include <ctre/phoenix6/CANcoder.hpp>
11#include <ctre/phoenix6/TalonFX.hpp>
14namespace TalonFXVelocityControllerHelper {
16 double p = 0.0, i = 0.0, d = 0.0, ff = 0.0;
18 units::second_t rampRate = 1.0_s;
22 double minOutput = -1.0, maxOutput = 1.0;
23 units::second_t rampRate = 1.0_s;
27 units::radians_per_second_t maxVelocity = 0.0_rad_per_s,
28 minVelocity = 0.0_rad_per_s;
29 units::radians_per_second_squared_t maxAcceleration = 0.0_rad_per_s_sq;
42 std::optional<TalonFXPositionControllerHelper::CANCoderConfig>
59 void setVelocity(units::radians_per_second_t velocity)
override;
86 virtual void stop()
override;
122 return 0.0_rad_per_s;
132 mutable ctre::phoenix6::hardware::TalonFX motorcontroller;
134 units::radians_per_second_t tolerance = 0.0_tps;
138 const bool usingCANCoder;
140 mutable std::optional<ctre::phoenix6::hardware::CANcoder> canCoder;
Definition AngularVelocityController.h:19
Definition TalonFXVelocityController.h:33
virtual double getPower() const override
virtual units::radians_per_second_t getTolerance() const override
Definition TalonFXVelocityController.h:121
units::radians_per_second_t getTargetVelocity() const override
virtual void setPower(double power) override
void setVelocity(units::radians_per_second_t velocity) override
units::radian_t getPosition() const override
void follow(const TalonFXVelocityController &parentController, bool inverted)
virtual void disable() override
virtual void stop() override
units::radians_per_second_t getVelocity() const override
void setEncoderPosition(units::radian_t position=0_rad) override
the master namespace of librmb
Definition LogitechGamepad.h:9
describes current limits for the motor. This was copied (and slightly modified to include units:: typ...
Definition TalonFXPositionController.h:30
Definition TalonFXPositionController.h:131
Definition TalonFXPositionController.h:19
Definition TalonFXVelocityController.h:35
Definition TalonFXVelocityController.h:21
Definition TalonFXVelocityController.h:15
Definition TalonFXVelocityController.h:26