7#include <rev/SparkMax.h>
8#include <rev/config/SparkMaxConfig.h>
9#include <rev/sim/SparkMaxSim.h>
11#include "valkyrie/controllers/BaseController.h"
15enum NeoControllerType { NEO, NEO_550 };
21 static constexpr frc::DCMotor getMotorSpec(NeoControllerType
controllerType) {
24 return frc::DCMotor::NEO550();
26 return frc::DCMotor::NEO();
32 void applyConfig()
override;
40 void setEncoderPosition(units::turn_t
position)
override;
42 units::turn_t getAbsEncoderPosition()
override;
66 void powerSetter(units::volt_t
voltage)
override;
70 units::volt_t calculateAppliedVoltage()
override;
72 void setSimState(frc::sim::DCMotorSim&)
override;
76 rev::spark::SparkMaxConfig config;
77 std::unique_ptr<rev::spark::SparkMax> followerMotor;
78 rev::spark::SparkMaxSim sim;
Abstract class that all Valor controllers's should implement.
Definition BaseController.h:53
T ReadLog(std::string_view field, const T &defaultValue={})
Read a value from NetworkTables for the given field.
Definition Loggable.h:343
Definition NeoController.h:17
void speedSetter(units::turns_per_second_t speed, int slot=0) override
Send the motor to a specific speed.
void setPIDF(valor::PIDF pidf, int slot=0, bool saveImmediately=false) override
Change the PIDF values for the motor.
units::ampere_t getCurrent() override
Get the motors output current.
units::turns_per_second_t getSpeed() override
Get the motors speed.
void setupFollower(int canID, bool followerInverted=false) override
If a motor is paired with another motor, setup that other motor as a follower.
void setGearRatios(double rotorToSensor, double sensorToMech, bool saveImmediately=false) override
Set the gear ratios for the motor.
void setReverseLimit(units::turn_t reverse, bool saveImmediately=false) override
Set the reverse soft limit for the motor.
void setForwardLimit(units::turn_t forward, bool saveImmediately=false) override
Set the forward soft limit for the motor.
units::turn_t getPosition() override
Get the motors position.
void reset() override
Resets the motor and any state.
void positionSetter(units::turn_t positon, int slot=0) override
Send the motor to a specific position.
void LoggablePeriodic() override
Periodic callback for logging updates.
Container to hold PID and feed forward values for the motor controller.
Definition PIDF.h:22