SubZero Common
Common library components for an FRC CommandRobot
|
#include <PidMotorController.h>
Additional Inherited Members | |
Public Member Functions inherited from subzero::PidMotorController< rev::CANSparkMax, rev::SparkPIDController, rev::SparkRelativeEncoder, rev::SparkAbsoluteEncoder > | |
PidMotorController (std::string name, rev::CANSparkMax &motor, rev::SparkRelativeEncoder &encoder, rev::SparkPIDController &controller, PidSettings pidSettings, rev::SparkAbsoluteEncoder *absEncoder, units::revolutions_per_minute_t maxRpm) | |
Construct a new PidMotorController. | |
void | Set (double percentage) override |
Set the motor to a percentage of max voltage. | |
void | Set (units::volt_t volts) override |
Set a motor to a voltage. | |
void | SetPidTolerance (double tolerance) override |
Absolute positioning is considered 'Done' when within this zone. | |
void | Update () override |
! Call this every loop in Periodic ! | |
void | RunWithVelocity (units::revolutions_per_minute_t rpm) override |
Set to this velocity. | |
void | RunWithVelocity (double percentage) override |
Set to a percentage of max RPM. | |
void | RunToPosition (double position) override |
Enables absolute positioning and sets the target to the position. | |
virtual void | ResetEncoder () override |
double | GetEncoderPosition () override |
std::optional< double > | GetAbsoluteEncoderPosition () override |
void | SetEncoderConversionFactor (double factor) override |
Sets the multiplier for going between encoder ticks and actual distance. | |
void | SetAbsoluteEncoderConversionFactor (double factor) override |
Sets the multiplier for going between encoder ticks and actual distance. | |
void | Stop () override |
Disable absolute positioning and stop the motor. | |
const PidSettings & | GetPidSettings () override |
void | UpdatePidSettings (PidSettings settings) override |
Public Member Functions inherited from subzero::IPidMotorController | |
IPidMotorController (std::string name) | |
Public Attributes inherited from subzero::IPidMotorController | |
const std::string | m_name |
Protected Attributes inherited from subzero::PidMotorController< rev::CANSparkMax, rev::SparkPIDController, rev::SparkRelativeEncoder, rev::SparkAbsoluteEncoder > | |
rev::CANSparkMax & | m_motor |
rev::SparkPIDController & | m_controller |
rev::SparkRelativeEncoder & | m_encoder |
rev::SparkAbsoluteEncoder * | m_absEncoder |
PidSettings | m_settings |
frc::PIDController | m_pidController |
bool | m_absolutePositionEnabled |
double | m_absoluteTarget |
const units::revolutions_per_minute_t | m_maxRpm |
Definition at line 207 of file PidMotorController.h.