Class TalonFXWrapper
java.lang.Object
com.team2813.lib2813.vendor.ctre.motor.TalonFXWrapper
- All Implemented Interfaces:
com.team2813.lib2813.control.Encoder,com.team2813.lib2813.control.Motor,com.team2813.lib2813.control.PIDMotor
-
Constructor Summary
ConstructorsConstructorDescriptionTalonFXWrapper(int canID, CANBus canbus, com.team2813.lib2813.control.InvertType invertType) Create a TalonFXWrapper on the specified canbus.TalonFXWrapper(int canID, com.team2813.lib2813.control.InvertType invertType) Create a TalonFXWrapper on the RoboRIO's canbusTalonFXWrapper(int canID, String canbusName, com.team2813.lib2813.control.InvertType invertType) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFollower(int deviceNumber, CANBus canbus, com.team2813.lib2813.control.InvertType invertType) voidaddFollower(int deviceNumber, com.team2813.lib2813.control.InvertType invertType) voidaddFollower(int deviceNumber, String canbus, com.team2813.lib2813.control.InvertType invertType) Deprecated, for removal: This API element is subject to removal in a future version.voidconfigPID(double p, double i, double d) voidconfigPID(int slot, double p, double i, double d) voidconfigPIDF(double p, double i, double d, double f) voidconfigPIDF(int slot, double p, double i, double d, double f) motor()voidset(com.team2813.lib2813.control.ControlMode controlMode, double demand) voidset(com.team2813.lib2813.control.ControlMode controlMode, double demand, double feedForward) voidSets the behavior the motor should exhibit upon receiving a request to stop:MotorSubsystem.stopMotor()Coast: The motor stops applying an input, but continues to move with its inertia.voidsetPosition(Angle position) voidSends a disable command to the motor, placing it in its neutral value.
-
Constructor Details
-
TalonFXWrapper
Create a TalonFXWrapper on the specified canbus.- Parameters:
canID- [0, 62] the can ID of the motorcanbus- the canbus that the motor is oninvertType- the invert type- Throws:
NullPointerException- if eitherinvertTypeorcanbusare nullIllegalArgumentException- ifinvertTypeis not inInvertType.rotationValues. In other words, this exception is thrown when passed anInvertTypethat is for following motorscom.team2813.lib2813.util.InvalidCanIdException- if the CAN id is invalid
-
TalonFXWrapper
@Deprecated(forRemoval=true) public TalonFXWrapper(int canID, String canbusName, com.team2813.lib2813.control.InvertType invertType) Deprecated, for removal: This API element is subject to removal in a future version.ConstructingDeviceInformationwith a CAN bus string is deprecated for removal in the 2027 season. Construct instances using aCANBusinstance instead.Create a TalonFXWrapper on the specified canbus name.- Parameters:
canID- [0, 62] the can ID of the motorcanbusName- the canbus that the motor is oninvertType- the invert type- Throws:
NullPointerException- if eitherinvertTypeorcanbusare nullIllegalArgumentException- ifinvertTypeis not inInvertType.rotationValues. In other words, this exception is thrown when passed anInvertTypethat is for following motorscom.team2813.lib2813.util.InvalidCanIdException- if the CAN id is invalid
-
TalonFXWrapper
public TalonFXWrapper(int canID, com.team2813.lib2813.control.InvertType invertType) Create a TalonFXWrapper on the RoboRIO's canbus- Parameters:
canID- [0, 62] the can ID of the motorinvertType- the invert type- Throws:
NullPointerException- ifinvertTypeis nullIllegalArgumentException- ifinvertTypeis not inInvertType.rotationValues. In other words, this exception is thrown when passed anInvertTypethat is for following motorscom.team2813.lib2813.util.InvalidCanIdException- if the CAN id is invalid
-
-
Method Details
-
set
public void set(com.team2813.lib2813.control.ControlMode controlMode, double demand) - Specified by:
setin interfacecom.team2813.lib2813.control.Motor
-
set
public void set(com.team2813.lib2813.control.ControlMode controlMode, double demand, double feedForward) - Specified by:
setin interfacecom.team2813.lib2813.control.Motor
-
getPositionMeasure
- Specified by:
getPositionMeasurein interfacecom.team2813.lib2813.control.Encoder
-
getAppliedCurrent
- Specified by:
getAppliedCurrentin interfacecom.team2813.lib2813.control.Motor
-
setPosition
- Specified by:
setPositionin interfacecom.team2813.lib2813.control.Encoder
-
getVelocityMeasure
- Specified by:
getVelocityMeasurein interfacecom.team2813.lib2813.control.Encoder
-
motor
-
setNeutralMode
Sets the behavior the motor should exhibit upon receiving a request to stop:MotorSubsystem.stopMotor()- Coast: The motor stops applying an input, but continues to move with its inertia.
- Brake: The motor stops applying an input, and actively opposes its inertia.
- Parameters:
mode-
-
stopMotor
public void stopMotor()Sends a disable command to the motor, placing it in its neutral value.- Specified by:
stopMotorin interfacecom.team2813.lib2813.control.Motor- See Also:
-
configPIDF
public void configPIDF(int slot, double p, double i, double d, double f) - Specified by:
configPIDFin interfacecom.team2813.lib2813.control.PIDMotor
-
configPIDF
public void configPIDF(double p, double i, double d, double f) - Specified by:
configPIDFin interfacecom.team2813.lib2813.control.PIDMotor
-
configPID
public void configPID(int slot, double p, double i, double d) - Specified by:
configPIDin interfacecom.team2813.lib2813.control.PIDMotor
-
configPID
public void configPID(double p, double i, double d) - Specified by:
configPIDin interfacecom.team2813.lib2813.control.PIDMotor
-
addFollower
@Deprecated(forRemoval=true) public void addFollower(int deviceNumber, String canbus, com.team2813.lib2813.control.InvertType invertType) Deprecated, for removal: This API element is subject to removal in a future version. -
addFollower
public void addFollower(int deviceNumber, CANBus canbus, com.team2813.lib2813.control.InvertType invertType) -
addFollower
public void addFollower(int deviceNumber, com.team2813.lib2813.control.InvertType invertType)
-
DeviceInformationwith a CAN bus string is deprecated for removal in the 2027 season.