3#if defined(WIN32) || defined(_WIN32) || defined(_WIN64)
5#pragma warning (disable : 4250)
15 namespace motorcontrol {
16 class SensorCollection;
17 class TalonSRXSimCollection;
24 namespace motorcontrol {
83 std::string
toString(std::string prependString) {
86 retstr += prependString +
".peakCurrentLimit = " + std::to_string(
peakCurrentLimit) +
";\n";
87 retstr += prependString +
".peakCurrentDuration = " + std::to_string(
peakCurrentDuration) +
";\n";
155#ifndef __FRC_ROBORIO__
161 TalonSRX(
int deviceNumber, std::string
const &canbus);
438#if defined(WIN32) || defined(_WIN32) || defined(_WIN64)
Collection of sensors available to a motor controller.
Definition SensorCollection.h:31
Collection of simulation commands available to a TalonSRX motor controller.
Definition TalonSRXSimCollection.h:26
Util class to help with talon configs.
Definition BaseTalon.h:223
CTRE Talon SRX Motor Controller when used on CAN Bus.
Definition BaseTalon.h:260
Util class to help with talon configs.
Definition TalonSRX.h:98
static bool ContinuousCurrentLimitDifferent(const TalonSRXConfiguration &settings)
Definition TalonSRX.h:110
static bool PeakCurrentDurationDifferent(const TalonSRXConfiguration &settings)
Definition TalonSRX.h:109
static bool PeakCurrentLimitDifferent(const TalonSRXConfiguration &settings)
Determine if specified value is different from default.
Definition TalonSRX.h:108
CTRE Talon SRX Motor Controller when used on CAN Bus.
Definition TalonSRX.h:145
virtual ctre::phoenix::ErrorCode ConfigSupplyCurrentLimit(const SupplyCurrentLimitConfiguration &currLimitConfigs, int timeoutMs=50)
Configures the supply (input) current limit.
TalonSRX(int deviceNumber)
Constructor for a Talon.
ctre::phoenix::ErrorCode ConfigurePID(const TalonSRXPIDSetConfiguration &pid, int pidIdx=0, int timeoutMs=50)
Sets all PID persistant settings.
ctre::phoenix::ErrorCode ConfigSelectedFeedbackSensor(RemoteFeedbackDevice feedbackDevice, int pidIdx, int timeoutMs)
Select the remote feedback device for the motor controller.
ctre::phoenix::ErrorCode ConfigContinuousCurrentLimit(int amps, int timeoutMs=0)
Configure the continuous allowable current-draw (when current limit is enabled).
ctre::phoenix::motorcontrol::TalonSRXSimCollection & GetSimCollection()
ctre::phoenix::ErrorCode ConfigSelectedFeedbackSensor(FeedbackDevice feedbackDevice, int pidIdx, int timeoutMs=0)
Select the feedback device for the motor controller.
virtual void Set(ControlMode mode, double value)
Sets the appropriate output on the talon, depending on the mode.
TalonSRX(int deviceNumber, std::string const &canbus)
Constructor so non-FRC platforms can specify a CAN 2.0 socketcan bus.
ctre::phoenix::ErrorCode ConfigSelectedFeedbackSensor(TalonSRXFeedbackDevice feedbackDevice, int pidIdx=0, int timeoutMs=0)
Select the feedback device for the motor controller.
ctre::phoenix::ErrorCode ConfigPeakCurrentLimit(int amps, int timeoutMs=0)
Configure the peak allowable current (when current limit is enabled).
void EnableCurrentLimit(bool enable)
Enable or disable Current Limit.
void GetAllConfigs(TalonSRXConfiguration &allConfigs, int timeoutMs=50)
Gets all persistant settings.
TalonSRX & operator=(TalonSRX const &)=delete
void Set(TalonSRXControlMode mode, double value)
Sets the appropriate output on the talon, depending on the mode.
TalonSRX(TalonSRX const &)=delete
ctre::phoenix::motorcontrol::SensorCollection & GetSensorCollection()
void GetPIDConfigs(TalonSRXPIDSetConfiguration &pid, int pidIdx=0, int timeoutMs=50)
Gets all PID set persistant settings.
void Set(TalonSRXControlMode mode, double demand0, DemandType demand1Type, double demand1)
virtual void Set(ControlMode mode, double demand0, DemandType demand1Type, double demand1)
ctre::phoenix::ErrorCode ConfigAllSettings(const TalonSRXConfiguration &allConfigs, int timeoutMs=50)
Configures all persistent settings.
ctre::phoenix::ErrorCode ConfigPeakCurrentDuration(int milliseconds, int timeoutMs=0)
Configure the peak allowable duration (when current limit is enabled).
ControlMode
Choose the control mode for a motor controller.
Definition ControlMode.h:11
DemandType
How to interpret a demand value.
Definition DemandType.h:10
RemoteFeedbackDevice
Choose the remote feedback device for a motor controller.
Definition FeedbackDevice.h:131
FeedbackDevice
Choose the feedback device for a motor controller.
Definition FeedbackDevice.h:14
@ QuadEncoder
Quadrature encoder.
TalonSRXFeedbackDevice
Choose the feedback device for a Talon SRX.
Definition FeedbackDevice.h:72
TalonSRXControlMode
Choose the control mode for a Talon SRX.
Definition ControlMode.h:57
ErrorCode
Definition ErrorCode.h:13
WPI Compliant CANcoder class.
Definition CANCoderStatusFrame.h:4
bool enableOptimizations
Enable optimizations for ConfigAll (defaults true)
Definition CustomParamConfiguration.h:23
Describes the desired stator current limiting behavior.
Definition SupplyCurrentLimitConfiguration.h:13
Configurables available to BaseTalon.
Definition BaseTalon.h:93
std::string toString()
Definition BaseTalon.h:190
Configurables available to BaseTalon's PID.
Definition BaseTalon.h:32
Configurables available to TalonSRX.
Definition TalonSRX.h:34
TalonSRXConfiguration()
Definition TalonSRX.h:63
std::string toString()
Definition TalonSRX.h:74
int continuousCurrentLimit
Continuous current in amps.
Definition TalonSRX.h:62
std::string toString(std::string prependString)
Definition TalonSRX.h:83
int peakCurrentLimit
Peak current in amps.
Definition TalonSRX.h:44
int peakCurrentDuration
Peak Current duration in milliseconds.
Definition TalonSRX.h:53
Configurables available to TalonSRX's PID.
Definition TalonSRX.h:30