Package frclib.motor
Class FrcCANTalonSRX
java.lang.Object
trclib.motor.TrcMotor
frclib.motor.FrcCANPhoenix5Controller<com.ctre.phoenix.motorcontrol.can.TalonSRX>
frclib.motor.FrcCANTalonSRX
- All Implemented Interfaces:
TrcMotorController
,TrcExclusiveSubsystem
,TrcOdometrySensor
public class FrcCANTalonSRX
extends FrcCANPhoenix5Controller<com.ctre.phoenix.motorcontrol.can.TalonSRX>
This class implements a CanTalonSrx motor controller. It extends the TrcMotor class and
implements the abstract methods required by TrcMotor to be compatible with the TRC library.
-
Nested Class Summary
Nested classes/interfaces inherited from class trclib.motor.TrcMotor
TrcMotor.ExternalSensors, TrcMotor.FollowerMotor, TrcMotor.PowerCompensation
Nested classes/interfaces inherited from interface trclib.robotcore.TrcExclusiveSubsystem
TrcExclusiveSubsystem.OwnershipParams
Nested classes/interfaces inherited from interface trclib.sensor.TrcOdometrySensor
TrcOdometrySensor.Odometry
-
Field Summary
Fields inherited from class frclib.motor.FrcCANPhoenix5Controller
motor
Fields inherited from class trclib.motor.TrcMotor
instanceName, motorGetPositionElapsedTimer, motorSetCurrentElapsedTimer, motorSetPositionElapsedTimer, motorSetPowerElapsedTimer, motorSetVelocityElapsedTimer, tracer
-
Constructor Summary
ConstructorsConstructorDescriptionFrcCANTalonSRX
(String instanceName, int canId) Constructor: Create an instance of the object.FrcCANTalonSRX
(String instanceName, int canId, TrcMotor.ExternalSensors sensors) Constructor: Create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setAbsoluteZeroOffset
(int rangeLow, int rangeHigh, boolean crossZeroOnInterval, int zeroOffset) This method synchronizes the internal encoder to the absolute zero position.Methods inherited from class frclib.motor.FrcCANPhoenix5Controller
disableMotorFwdLimitSwitch, disableMotorRevLimitSwitch, enableMotorFwdLimitSwitch, enableMotorRevLimitSwitch, follow, getBusVoltage, getEncoderSendable, getErrorCount, getLastError, getMotorCurrent, getMotorCurrentPidCoefficients, getMotorPosition, getMotorPositionPidCoefficients, getMotorPower, getMotorVelocity, getMotorVelocityPidCoefficients, isMotorFwdLimitSwitchActive, isMotorFwdLimitSwitchEnabled, isMotorInverted, isMotorPositionSensorInverted, isMotorRevLimitSwitchActive, isMotorRevLimitSwitchEnabled, isVoltageCompensationEnabled, recordResponseCode, resetFactoryDefault, resetMotorPosition, setBrakeModeEnabled, setCloseLoopRampRate, setCurrentLimit, setFeedbackDevice, setMotorCurrent, setMotorCurrentPidCoefficients, setMotorFwdLimitSwitchInverted, setMotorFwdSoftPositionLimit, setMotorInverted, setMotorPosition, setMotorPositionPidCoefficients, setMotorPositionSensorInverted, setMotorPower, setMotorRevLimitSwitchInverted, setMotorRevSoftPositionLimit, setMotorVelocity, setMotorVelocityPidCoefficients, setOpenLoopRampRate, setStatorCurrentLimit, setVoltageCompensationEnabled
Methods inherited from class trclib.motor.TrcMotor
addFollower, cancel, clearOdometryMotorsList, convertPositionToScaledUnits, convertPositionToSensorUnits, disableLowerLimitSwitch, disableMotionProfile, disableUpperLimitSwitch, enableLowerLimitSwitch, enableMotionProfile, enableUpperLimitSwitch, follow, getCurrent, getCurrentOnTarget, getCurrentPidCoefficients, getCurrentPidController, getEncoderRawPosition, getFollower, getName, getNumOdometryMotors, getOdometry, getPidTarget, getPosition, getPositionOnTarget, getPositionPidCoefficients, getPositionPidController, getPower, getVelocity, getVelocityOnTarget, getVelocityPidCoefficients, getVelocityPidController, isCalibrating, isLowerLimitSwitchActive, isLowerLimitSwitchEnabled, isOdometryEnabled, isPositionSensorInverted, isUpperLimitSwitchActive, isUpperLimitSwitchEnabled, presetPositionDown, presetPositionUp, presetVelocityDown, presetVelocityUp, printElapsedTime, printPidControlTaskPerformance, resetOdometry, resetPosition, resetPosition, resetPositionOnLowerLimitSwitch, resetPositionOnLowerLimitSwitch, resetPositionOnLowerLimitSwitch, resetPositionOnLowerLimitSwitch, setBeep, setBeep, setCurrent, setCurrent, setCurrent, setCurrent, setCurrentPidParameters, setCurrentPidParameters, setCurrentPidParameters, setCurrentPidPowerComp, setCurrentPidTolerance, setElapsedTimerEnabled, setLimitSwitchesSwapped, setLowerLimitSwitchInverted, setOdometryEnabled, setPerformanceMonitorEnabled, setPidPower, setPidPower, setPidStallDetectionEnabled, setPidStallDetectionEnabled, setPosition, setPosition, setPosition, setPosition, setPosition, setPosition, setPosition, setPositionPidParameters, setPositionPidParameters, setPositionPidParameters, setPositionPidPowerComp, setPositionPidTolerance, setPositionSensorInverted, setPositionSensorScaleAndOffset, setPositionSensorScaleAndOffset, setPower, setPower, setPower, setPower, setPresetPosition, setPresets, setPresetVelocity, setSoftPositionLimits, setSoftwarePidEnabled, setStallProtection, setTraceLevel, setUpperLimitSwitchInverted, setVelocity, setVelocity, setVelocity, setVelocity, setVelocityParameters, setVelocityPidParameters, setVelocityPidParameters, setVelocityPidPowerComp, setVelocityPidTolerance, stop, toString, zeroCalibrate, zeroCalibrate, zeroCalibrate, zeroCalibrate, zeroCalibrate, zeroCalibrate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface trclib.robotcore.TrcExclusiveSubsystem
acquireExclusiveAccess, acquireOwnership, cancelExclusiveAccess, getCurrentOwner, hasOwnership, releaseExclusiveAccess, releaseOwnership, validateOwnership
Methods inherited from interface trclib.sensor.TrcOdometrySensor
getOdometries, getOdometry
-
Constructor Details
-
FrcCANTalonSRX
Constructor: Create an instance of the object.- Parameters:
instanceName
- specifies the instance name.canId
- specifies the CAN ID of the device.sensors
- specifies external sensors, can be null if none.
-
FrcCANTalonSRX
Constructor: Create an instance of the object.- Parameters:
instanceName
- specifies the instance name.canId
- specifies the CAN ID of the device.
-
-
Method Details
-
setAbsoluteZeroOffset
public void setAbsoluteZeroOffset(int rangeLow, int rangeHigh, boolean crossZeroOnInterval, int zeroOffset) This method synchronizes the internal encoder to the absolute zero position.- Parameters:
rangeLow
- specifies the low range of the absolute encoder reading.rangeHigh
- specifies the high range of the absolute encoder reading.crossZeroOnInterval
- specifies true if the absoulte encoder will cross the zero point.zeroOffset
- specifies the encoder offset of the absolute zero position.
-