Package org.team1540.rooster.wrappers
Class ChickenTalon
- java.lang.Object
-
- com.ctre.phoenix.motorcontrol.can.BaseMotorController
-
- com.ctre.phoenix.motorcontrol.can.BaseTalon
-
- com.ctre.phoenix.motorcontrol.can.TalonSRX
-
- org.team1540.rooster.wrappers.ChickenTalon
-
- All Implemented Interfaces:
com.ctre.phoenix.motorcontrol.IFollower
,com.ctre.phoenix.motorcontrol.IMotorController
,com.ctre.phoenix.motorcontrol.IMotorControllerEnhanced
,com.ctre.phoenix.signals.IInvertable
,com.ctre.phoenix.signals.IOutputSignal
,ChickenController
public class ChickenTalon extends com.ctre.phoenix.motorcontrol.can.TalonSRX implements ChickenController
Wrapper around aTalonSRX
adding some features (that really should already be there) as well as making functions easier to call.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChickenTalon.TalonControlMode
Deprecated.UseControlMode
-
Constructor Summary
Constructors Constructor Description ChickenTalon(int deviceNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
changeControlMode(ChickenTalon.TalonControlMode controlMode)
Deprecated.com.ctre.phoenix.ErrorCode
clearMotionProfileHasUnderrun()
com.ctre.phoenix.ErrorCode
clearStickyFaults()
com.ctre.phoenix.ErrorCode
config_IntegralZone(int slotIdx, int izone)
Sets the Integral Zone constant in the given parameter slot.com.ctre.phoenix.ErrorCode
config_kD(int slotIdx, double value)
Sets the 'D' constant in the given parameter slot.com.ctre.phoenix.ErrorCode
config_kF(int slotIdx, double value)
Sets the 'F' constant in the given parameter slot.com.ctre.phoenix.ErrorCode
config_kI(int slotIdx, double value)
Sets the 'I' constant in the given parameter slot.com.ctre.phoenix.ErrorCode
config_kP(int slotIdx, double value)
Sets the 'P' constant in the given parameter slot.com.ctre.phoenix.ErrorCode
configAllowableClosedloopError(int slotIdx, int allowableClosedLoopError)
Sets the allowable closed-loop error in the given parameter slot.com.ctre.phoenix.ErrorCode
configClosedloopRamp(double secondsFromNeutralToFull)
Configures the closed-loop ramp rate of throttle output.com.ctre.phoenix.ErrorCode
configContinuousCurrentLimit(int amps)
void
configEncoderCodesPerRev(int codesPerRev)
Deprecated.Functionality removed.com.ctre.phoenix.ErrorCode
configForwardLimitSwitchSource(com.ctre.phoenix.motorcontrol.LimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose)
com.ctre.phoenix.ErrorCode
configForwardLimitSwitchSource(com.ctre.phoenix.motorcontrol.RemoteLimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose, int deviceID)
Configures the forward limit switch for a remote source.com.ctre.phoenix.ErrorCode
configForwardSoftLimitEnable(boolean enable)
Configures the forward soft limit enable.com.ctre.phoenix.ErrorCode
configForwardSoftLimitThreshold(int forwardSensorLimit)
Configures the forward soft limit threhold.int
configGetCustomParam(int paramIndex)
Gets the value of a custom parameter.double
configGetParameter(int param, int ordinal)
Gets a parameter.double
configGetParameter(com.ctre.phoenix.ParamEnum param, int ordinal)
Gets a parameter.com.ctre.phoenix.ErrorCode
configMaxIntegralAccumulator(int slotIdx, double iaccum)
Sets the maximum integral accumulator in the given parameter slot.com.ctre.phoenix.ErrorCode
configMotionAcceleration(int sensorUnitsPer100msPerSec)
Sets the Motion Magic Acceleration.com.ctre.phoenix.ErrorCode
configMotionCruiseVelocity(int sensorUnitsPer100ms)
Sets the Motion Magic Cruise Velocity.com.ctre.phoenix.ErrorCode
configNeutralDeadband(double percentDeadband)
Configures the output deadband percentage.com.ctre.phoenix.ErrorCode
configNominalOutputForward(double percentOut)
Configures the forward nominal output percentage.com.ctre.phoenix.ErrorCode
configNominalOutputReverse(double percentOut)
Configures the reverse nominal output percentage.void
configNominalOutputVoltage(double forwardVoltage, double reverseVoltage)
Deprecated.com.ctre.phoenix.ErrorCode
configOpenloopRamp(double secondsFromNeutralToFull)
Configures the open-loop ramp rate of throttle output.com.ctre.phoenix.ErrorCode
configPeakCurrentDuration(int milliseconds)
com.ctre.phoenix.ErrorCode
configPeakCurrentLimit(int amps)
com.ctre.phoenix.ErrorCode
configPeakOutputForward(double percentOut)
Configures the forward peak output percentage.com.ctre.phoenix.ErrorCode
configPeakOutputReverse(double percentOut)
Configures the reverse peak output percentage.void
configPeakOutputVoltage(double forwardVoltage, double reverseVoltage)
Deprecated.com.ctre.phoenix.ErrorCode
configRemoteFeedbackFilter(int deviceID, com.ctre.phoenix.motorcontrol.RemoteSensorSource remoteSensorSource, int remoteOrdinal)
com.ctre.phoenix.ErrorCode
configReverseLimitSwitchSource(com.ctre.phoenix.motorcontrol.LimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose)
com.ctre.phoenix.ErrorCode
configReverseLimitSwitchSource(com.ctre.phoenix.motorcontrol.RemoteLimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose, int deviceID)
Configures the reverse limit switch for a remote source.com.ctre.phoenix.ErrorCode
configReverseSoftLimitEnable(boolean enable)
Configures the reverse soft limit enable.com.ctre.phoenix.ErrorCode
configReverseSoftLimitThreshold(int reverseSensorLimit)
Configures the reverse soft limit threshold.com.ctre.phoenix.ErrorCode
configSelectedFeedbackSensor(com.ctre.phoenix.motorcontrol.FeedbackDevice feedbackDevice)
Select the feedback device for the motor controller.com.ctre.phoenix.ErrorCode
configSelectedFeedbackSensor(com.ctre.phoenix.motorcontrol.FeedbackDevice feedbackDevice, int pidIdx)
Select the feedback device for the motor controller.com.ctre.phoenix.ErrorCode
configSelectedFeedbackSensor(com.ctre.phoenix.motorcontrol.RemoteFeedbackDevice feedbackDevice)
Select the remote feedback device for the motor controller.com.ctre.phoenix.ErrorCode
configSelectedFeedbackSensor(com.ctre.phoenix.motorcontrol.RemoteFeedbackDevice feedbackDevice, int pidIdx)
Select the remote feedback device for the motor controller.com.ctre.phoenix.ErrorCode
configSensorTerm(com.ctre.phoenix.motorcontrol.SensorTerm sensorTerm, com.ctre.phoenix.motorcontrol.FeedbackDevice feedbackDevice)
com.ctre.phoenix.ErrorCode
configSetCustomParam(int newValue, int paramIndex)
Sets the value of a custom parameter.com.ctre.phoenix.ErrorCode
configSetParameter(int param, double value, int subValue, int ordinal)
Sets a parameter.com.ctre.phoenix.ErrorCode
configSetParameter(com.ctre.phoenix.ParamEnum param, double value, int subValue, int ordinal)
Sets a parameter.com.ctre.phoenix.ErrorCode
configVelocityMeasurementPeriod(int period)
Sets the period over which velocity measurements are taken.com.ctre.phoenix.ErrorCode
configVelocityMeasurementWindow(int windowSize)
com.ctre.phoenix.ErrorCode
configVoltageCompSaturation(double voltage)
Configures the Voltage Compensation saturation voltage.com.ctre.phoenix.ErrorCode
configVoltageMeasurementFilter(int filterWindowSamples)
Configures the voltage measurement filter.void
enableBrakeMode(boolean brake)
Deprecated.int
getAnalogIn()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.int
getAnalogInRaw()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.int
getAnalogInVel()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.int
getClosedLoopError()
Gets the closed-loop error.com.ctre.phoenix.motorcontrol.ControlMode
getControlMode()
Note that this does not return the currently set control mode in the talon wrapper and may be different than the control mode set usingsetControlMode(ControlMode)
.int
getDefaultPidIdx()
int
getDefaultTimeoutMs()
double
getEncoderCodesPerRev()
Deprecated.This no longer has any effect as natural units functionality has been removed.int
getEncPosition()
Deprecated.int
getEncVelocity()
Deprecated.double
getError()
Deprecated.double
getErrorDerivative()
Gets the derivative of the closed-loop error.double
getIntegralAccumulator()
Gets the iaccum value.double
getOutputVoltage()
Deprecated.UseBaseMotorController.getMotorOutputVoltage()
double
getPeakOutputForward()
Gets the forward peak output percentage.double
getPeakOutputReverse()
Gets the reverse peak output percentage.boolean
getPinStateQuadA()
Gets pin state quad a.boolean
getPinStateQuadB()
Gets pin state quad b.boolean
getPinStateQuadIdx()
Gets pin state quad index.double
getPosition()
Deprecated.int
getPulseWidthPosition()
Gets pulse width position.int
getPulseWidthRiseToFallUs()
Gets pulse width rise to fall us.int
getPulseWidthRiseToRiseUs()
Gets pulse width rise to rise us.int
getPulseWidthVelocity()
Gets pulse width velocity.int
getQuadraturePosition()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.int
getQuadratureVelocity()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.int
getSelectedSensorPosition()
Get the selected sensor position.int
getSelectedSensorVelocity()
Get the selected sensor velocity.double
getSetpoint()
Deprecated.UseBaseMotorController.getClosedLoopTarget(int)
double
getSpeed()
Deprecated.int
getStatusFramePeriod(int frame)
Gets the period of the given status frame.int
getStatusFramePeriod(com.ctre.phoenix.motorcontrol.StatusFrame frame)
Gets the period of the given status frame.int
getStatusFramePeriod(com.ctre.phoenix.motorcontrol.StatusFrameEnhanced frame)
void
reverseOutput(boolean flip)
Deprecated.UseBaseMotorController.setInverted(boolean)
void
reverseSensor(boolean flip)
Deprecated.UseBaseMotorController.setSensorPhase(boolean)
void
selectProfileSlot(int slotIdx)
Selects which profile slot to use for closed-loop control.void
set(double outputValue)
Sets the appropriate output on the talon, depending on the mode.com.ctre.phoenix.ErrorCode
setAnalogPosition(int newPosition)
Sets analog position.void
setBrake(boolean brake)
Sets the mode of operation during neutral throttle output.void
setControlMode(int mode)
Deprecated.void
setControlMode(com.ctre.phoenix.motorcontrol.ControlMode controlMode)
void
setD(double d)
Deprecated.void
setDefaultPidIdx(int defaultPidIdx)
void
setDefaultTimeoutMs(int defaultTimeoutMs)
void
setEncoderCodesPerRev(double encoderCodesPerRev)
Deprecated.This no longer has any effect as natural units functionality has been removed.void
setF(double f)
Deprecated.UseBaseMotorController.config_kF(int, double, int)
void
setFeedbackDevice(com.ctre.phoenix.motorcontrol.FeedbackDevice device)
Deprecated.void
setI(double i)
Deprecated.com.ctre.phoenix.ErrorCode
setIntegralAccumulator(double iaccum)
Sets the integral accumulator.com.ctre.phoenix.ErrorCode
setIntegralAccumulator(double iaccum, int pidIdx)
Sets the integral accumulator.void
setP(double p)
Deprecated.void
setPID(double p, double i, double d)
Deprecated.void
setPosition(double pos)
Deprecated.void
setProfile(int profile)
Deprecated.com.ctre.phoenix.ErrorCode
setPulseWidthPosition(int newPosition)
Sets pulse width position.com.ctre.phoenix.ErrorCode
setQuadraturePosition(int newPosition)
Change the quadrature reported position.com.ctre.phoenix.ErrorCode
setSelectedSensorPosition(int sensorPos)
Sets the sensor position to the given value.com.ctre.phoenix.ErrorCode
setSelectedSensorPosition(int sensorPos, int pidIdx)
Sets the sensor position to the given value.void
setSetpoint(double setpoint)
Deprecated.Useset(double)
com.ctre.phoenix.ErrorCode
setStatusFramePeriod(int frameValue, int periodMs)
Sets the period of the given status frame.com.ctre.phoenix.ErrorCode
setStatusFramePeriod(com.ctre.phoenix.motorcontrol.StatusFrameEnhanced frame, int periodMs)
com.ctre.phoenix.ErrorCode
setStatusFramePeriod(com.ctre.phoenix.motorcontrol.StatusFrame frame, int periodMs)
Sets the period of the given status frame.void
setVoltageRampRate(double rampRate)
Deprecated.-
Methods inherited from class com.ctre.phoenix.motorcontrol.can.TalonSRX
configAllSettings, configAllSettings, configContinuousCurrentLimit, configPeakCurrentDuration, configPeakCurrentLimit, configSelectedFeedbackSensor, configSupplyCurrentLimit, configSupplyCurrentLimit, configurePID, configurePID, enableCurrentLimit, getAllConfigs, getAllConfigs, getPIDConfigs, getPIDConfigs, getSensorCollection
-
Methods inherited from class com.ctre.phoenix.motorcontrol.can.BaseTalon
configAllSettings, configAllSettings, configForwardLimitSwitchSource, configReverseLimitSwitchSource, configurePID, configurePID, configVelocityMeasurementPeriod, configVelocityMeasurementPeriod, configVelocityMeasurementWindow, getAllConfigs, getAllConfigs, getOutputCurrent, getPIDConfigs, getPIDConfigs, getStatorCurrent, getStatusFramePeriod, getSupplyCurrent, getTalonFXSensorCollection, getTalonSRXSensorCollection, isFwdLimitSwitchClosed, isRevLimitSwitchClosed, setStatusFramePeriod
-
Methods inherited from class com.ctre.phoenix.motorcontrol.can.BaseMotorController
baseConfigAllSettings, baseConfigurePID, baseGetAllConfigs, baseGetPIDConfigs, changeMotionControlFramePeriod, clearMotionProfileHasUnderrun, clearMotionProfileTrajectories, clearStickyFaults, config_IntegralZone, config_kD, config_kF, config_kI, config_kP, configAllowableClosedloopError, configAuxPIDPolarity, configAuxPIDPolarity, configClearPositionOnLimitF, configClearPositionOnLimitR, configClearPositionOnQuadIdx, configClosedLoopPeakOutput, configClosedLoopPeakOutput, configClosedLoopPeriod, configClosedLoopPeriod, configClosedloopRamp, configFactoryDefault, configFactoryDefault, configFeedbackNotContinuous, configForwardLimitSwitchSource, configForwardLimitSwitchSource, configForwardSoftLimitEnable, configForwardSoftLimitThreshold, configGetCustomParam, configGetParameter, configGetParameter, configLimitSwitchDisableNeutralOnLOS, configMaxIntegralAccumulator, configMotionAcceleration, configMotionCruiseVelocity, configMotionProfileTrajectoryInterpolationEnable, configMotionProfileTrajectoryInterpolationEnable, configMotionProfileTrajectoryPeriod, configMotionProfileTrajectoryPeriod, configMotionSCurveStrength, configMotionSCurveStrength, configNeutralDeadband, configNominalOutputForward, configNominalOutputReverse, configOpenloopRamp, configPeakOutputForward, configPeakOutputReverse, configPulseWidthPeriod_EdgesPerRot, configPulseWidthPeriod_FilterWindowSz, configRemoteFeedbackFilter, configRemoteSensorClosedLoopDisableNeutralOnLOS, configReverseLimitSwitchSource, configReverseLimitSwitchSource, configReverseSoftLimitEnable, configReverseSoftLimitThreshold, configSelectedFeedbackCoefficient, configSelectedFeedbackCoefficient, configSelectedFeedbackSensor, configSelectedFeedbackSensor, configSensorTerm, configSensorTerm, configSensorTerm, configSetCustomParam, configSetParameter, configSetParameter, configSoftLimitDisableNeutralOnLOS, configureFilter, configureFilter, configureFilter, configureSlot, configureSlot, configVoltageCompSaturation, configVoltageMeasurementFilter, DestroyObject, enableHeadingHold, enableVoltageCompensation, follow, follow, getActiveTrajectoryArbFeedFwd, getActiveTrajectoryArbFeedFwd, getActiveTrajectoryHeading, getActiveTrajectoryPosition, getActiveTrajectoryPosition, getActiveTrajectoryVelocity, getActiveTrajectoryVelocity, getBaseID, getBusVoltage, getClosedLoopError, getClosedLoopTarget, getClosedLoopTarget, getDeviceID, getErrorDerivative, getFaults, getFilterConfigs, getFilterConfigs, getFirmwareVersion, getHandle, getIntegralAccumulator, getInverted, getLastError, getMotionProfileStatus, getMotionProfileTopLevelBufferCount, getMotorOutputPercent, getMotorOutputVoltage, getSelectedSensorPosition, getSelectedSensorVelocity, getSlotConfigs, getSlotConfigs, getStatusFramePeriod, getStatusFramePeriod, getStickyFaults, getTemperature, hasResetOccurred, isMotionProfileFinished, isMotionProfileTopLevelBufferFull, neutralOutput, overrideLimitSwitchesEnable, overrideSoftLimitsEnable, processMotionProfileBuffer, pushMotionProfileTrajectory, selectDemandType, selectProfileSlot, set, set, set, setControlFramePeriod, setControlFramePeriod, setIntegralAccumulator, setInverted, setInverted, setNeutralMode, setSelectedSensorPosition, setSensorPhase, setStatusFramePeriod, setStatusFramePeriod, startMotionProfile, valueUpdated
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ctre.phoenix.motorcontrol.IMotorController
changeMotionControlFramePeriod, clearMotionProfileHasUnderrun, clearMotionProfileTrajectories, clearStickyFaults, config_IntegralZone, config_kD, config_kF, config_kI, config_kP, configAllowableClosedloopError, configAuxPIDPolarity, configClosedLoopPeakOutput, configClosedLoopPeriod, configClosedloopRamp, configForwardLimitSwitchSource, configForwardSoftLimitEnable, configForwardSoftLimitThreshold, configGetCustomParam, configGetParameter, configGetParameter, configMaxIntegralAccumulator, configMotionAcceleration, configMotionCruiseVelocity, configMotionProfileTrajectoryPeriod, configMotionSCurveStrength, configNeutralDeadband, configNominalOutputForward, configNominalOutputReverse, configOpenloopRamp, configPeakOutputForward, configPeakOutputReverse, configRemoteFeedbackFilter, configReverseLimitSwitchSource, configReverseSoftLimitEnable, configReverseSoftLimitThreshold, configSelectedFeedbackCoefficient, configSelectedFeedbackSensor, configSensorTerm, configSetCustomParam, configSetParameter, configSetParameter, configVoltageCompSaturation, configVoltageMeasurementFilter, enableVoltageCompensation, getActiveTrajectoryHeading, getActiveTrajectoryPosition, getActiveTrajectoryVelocity, getBaseID, getBusVoltage, getClosedLoopError, getClosedLoopTarget, getDeviceID, getErrorDerivative, getFaults, getFirmwareVersion, getIntegralAccumulator, getInverted, getLastError, getMotionProfileStatus, getMotionProfileTopLevelBufferCount, getMotorOutputPercent, getMotorOutputVoltage, getSelectedSensorPosition, getSelectedSensorVelocity, getStatusFramePeriod, getStickyFaults, getTemperature, hasResetOccurred, isMotionProfileTopLevelBufferFull, neutralOutput, overrideLimitSwitchesEnable, overrideSoftLimitsEnable, processMotionProfileBuffer, pushMotionProfileTrajectory, selectProfileSlot, set, set, set, setControlFramePeriod, setIntegralAccumulator, setInverted, setNeutralMode, setSelectedSensorPosition, setSensorPhase, setStatusFramePeriod
-
-
-
-
Method Detail
-
clearMotionProfileHasUnderrun
public com.ctre.phoenix.ErrorCode clearMotionProfileHasUnderrun()
- Specified by:
clearMotionProfileHasUnderrun
in interfaceChickenController
- Overrides:
clearMotionProfileHasUnderrun
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
-
clearStickyFaults
public com.ctre.phoenix.ErrorCode clearStickyFaults()
- Specified by:
clearStickyFaults
in interfaceChickenController
- Overrides:
clearStickyFaults
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
-
configAllowableClosedloopError
public com.ctre.phoenix.ErrorCode configAllowableClosedloopError(int slotIdx, int allowableClosedLoopError)
Sets the allowable closed-loop error in the given parameter slot.- Specified by:
configAllowableClosedloopError
in interfaceChickenController
- Overrides:
configAllowableClosedloopError
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
slotIdx
- Parameter slot for the constant.allowableClosedLoopError
- Value of the allowable closed-loop error.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configClosedloopRamp
public com.ctre.phoenix.ErrorCode configClosedloopRamp(double secondsFromNeutralToFull)
Configures the closed-loop ramp rate of throttle output.- Specified by:
configClosedloopRamp
in interfaceChickenController
- Overrides:
configClosedloopRamp
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
secondsFromNeutralToFull
- Minimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configContinuousCurrentLimit
public com.ctre.phoenix.ErrorCode configContinuousCurrentLimit(int amps)
- Overrides:
configContinuousCurrentLimit
in classcom.ctre.phoenix.motorcontrol.can.TalonSRX
-
configForwardLimitSwitchSource
public com.ctre.phoenix.ErrorCode configForwardLimitSwitchSource(com.ctre.phoenix.motorcontrol.LimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose)
- Specified by:
configForwardLimitSwitchSource
in interfaceChickenController
- Overrides:
configForwardLimitSwitchSource
in classcom.ctre.phoenix.motorcontrol.can.BaseTalon
-
configForwardLimitSwitchSource
public com.ctre.phoenix.ErrorCode configForwardLimitSwitchSource(com.ctre.phoenix.motorcontrol.RemoteLimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose, int deviceID)
Configures the forward limit switch for a remote source.- Specified by:
configForwardLimitSwitchSource
in interfaceChickenController
- Overrides:
configForwardLimitSwitchSource
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
type
- Remote limit switch source. @see #LimitSwitchSourcenormalOpenOrClose
- Setting for normally open or normally closed.deviceID
- Device ID of remote source.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configForwardSoftLimitEnable
public com.ctre.phoenix.ErrorCode configForwardSoftLimitEnable(boolean enable)
Configures the forward soft limit enable.- Specified by:
configForwardSoftLimitEnable
in interfaceChickenController
- Overrides:
configForwardSoftLimitEnable
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
enable
- Forward Sensor Position Limit Enable.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configForwardSoftLimitThreshold
public com.ctre.phoenix.ErrorCode configForwardSoftLimitThreshold(int forwardSensorLimit)
Configures the forward soft limit threhold.- Specified by:
configForwardSoftLimitThreshold
in interfaceChickenController
- Overrides:
configForwardSoftLimitThreshold
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
forwardSensorLimit
- Forward Sensor Position Limit (in Raw Sensor Units).- Returns:
- Error Code generated by function. 0 indicates no error.
-
configGetCustomParam
public int configGetCustomParam(int paramIndex)
Gets the value of a custom parameter.- Specified by:
configGetCustomParam
in interfaceChickenController
- Overrides:
configGetCustomParam
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
paramIndex
- Index of custom parameter.- Returns:
- Value of the custom param.
-
configGetParameter
public double configGetParameter(com.ctre.phoenix.ParamEnum param, int ordinal)
Gets a parameter.- Specified by:
configGetParameter
in interfaceChickenController
- Overrides:
configGetParameter
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
param
- Parameter enumeration.ordinal
- Ordinal of parameter.- Returns:
- Value of parameter.
-
configGetParameter
public double configGetParameter(int param, int ordinal)
Gets a parameter.- Specified by:
configGetParameter
in interfaceChickenController
- Overrides:
configGetParameter
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
param
- Parameter enumeration.ordinal
- Ordinal of parameter.- Returns:
- Value of parameter.
-
configMaxIntegralAccumulator
public com.ctre.phoenix.ErrorCode configMaxIntegralAccumulator(int slotIdx, double iaccum)
Sets the maximum integral accumulator in the given parameter slot.- Specified by:
configMaxIntegralAccumulator
in interfaceChickenController
- Overrides:
configMaxIntegralAccumulator
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
slotIdx
- Parameter slot for the constant.iaccum
- Value of the maximum integral accumulator.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configMotionAcceleration
public com.ctre.phoenix.ErrorCode configMotionAcceleration(int sensorUnitsPer100msPerSec)
Sets the Motion Magic Acceleration.- Specified by:
configMotionAcceleration
in interfaceChickenController
- Overrides:
configMotionAcceleration
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
sensorUnitsPer100msPerSec
- Motion Magic Acceleration (in Raw Sensor Units per 100 ms per second).- Returns:
- Error Code generated by function. 0 indicates no error.
-
configMotionCruiseVelocity
public com.ctre.phoenix.ErrorCode configMotionCruiseVelocity(int sensorUnitsPer100ms)
Sets the Motion Magic Cruise Velocity.- Specified by:
configMotionCruiseVelocity
in interfaceChickenController
- Overrides:
configMotionCruiseVelocity
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
sensorUnitsPer100ms
- Motion Magic Cruise Velocity (in Raw Sensor Units per 100 ms).- Returns:
- Error Code generated by function. 0 indicates no error.
-
configNeutralDeadband
public com.ctre.phoenix.ErrorCode configNeutralDeadband(double percentDeadband)
Configures the output deadband percentage.- Specified by:
configNeutralDeadband
in interfaceChickenController
- Overrides:
configNeutralDeadband
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
percentDeadband
- Desired deadband percentage. Minimum is 0.1%, Maximum is 25%. Pass 0.04 for 4%.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configNominalOutputForward
public com.ctre.phoenix.ErrorCode configNominalOutputForward(double percentOut)
Configures the forward nominal output percentage.- Specified by:
configNominalOutputForward
in interfaceChickenController
- Overrides:
configNominalOutputForward
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
percentOut
- Nominal (minimum) percent output.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configNominalOutputReverse
public com.ctre.phoenix.ErrorCode configNominalOutputReverse(double percentOut)
Configures the reverse nominal output percentage.- Specified by:
configNominalOutputReverse
in interfaceChickenController
- Overrides:
configNominalOutputReverse
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
percentOut
- Nominal (minimum) percent output.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configOpenloopRamp
public com.ctre.phoenix.ErrorCode configOpenloopRamp(double secondsFromNeutralToFull)
Configures the open-loop ramp rate of throttle output.- Specified by:
configOpenloopRamp
in interfaceChickenController
- Overrides:
configOpenloopRamp
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
secondsFromNeutralToFull
- Minimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configPeakCurrentDuration
public com.ctre.phoenix.ErrorCode configPeakCurrentDuration(int milliseconds)
- Overrides:
configPeakCurrentDuration
in classcom.ctre.phoenix.motorcontrol.can.TalonSRX
-
configPeakCurrentLimit
public com.ctre.phoenix.ErrorCode configPeakCurrentLimit(int amps)
- Overrides:
configPeakCurrentLimit
in classcom.ctre.phoenix.motorcontrol.can.TalonSRX
-
configPeakOutputForward
public com.ctre.phoenix.ErrorCode configPeakOutputForward(double percentOut)
Description copied from interface:ChickenController
Configures the forward peak output percentage.- Specified by:
configPeakOutputForward
in interfaceChickenController
- Overrides:
configPeakOutputForward
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
percentOut
- Desired peak output percentage.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configPeakOutputReverse
public com.ctre.phoenix.ErrorCode configPeakOutputReverse(double percentOut)
Description copied from interface:ChickenController
Configures the reverse peak output percentage.- Specified by:
configPeakOutputReverse
in interfaceChickenController
- Overrides:
configPeakOutputReverse
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
percentOut
- Desired peak output percentage.- Returns:
- Error Code generated by function. 0 indicates no error.
-
getPeakOutputForward
public double getPeakOutputForward()
Description copied from interface:ChickenController
Gets the forward peak output percentage.- Specified by:
getPeakOutputForward
in interfaceChickenController
- Returns:
- Double from -1 to 1 inclusive.
-
getPeakOutputReverse
public double getPeakOutputReverse()
Description copied from interface:ChickenController
Gets the reverse peak output percentage.- Specified by:
getPeakOutputReverse
in interfaceChickenController
- Returns:
- Double from -1 to 1 inclusive.
-
configRemoteFeedbackFilter
public com.ctre.phoenix.ErrorCode configRemoteFeedbackFilter(int deviceID, com.ctre.phoenix.motorcontrol.RemoteSensorSource remoteSensorSource, int remoteOrdinal)
- Specified by:
configRemoteFeedbackFilter
in interfaceChickenController
- Overrides:
configRemoteFeedbackFilter
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
-
configReverseLimitSwitchSource
public com.ctre.phoenix.ErrorCode configReverseLimitSwitchSource(com.ctre.phoenix.motorcontrol.LimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose)
- Overrides:
configReverseLimitSwitchSource
in classcom.ctre.phoenix.motorcontrol.can.BaseTalon
-
configReverseLimitSwitchSource
public com.ctre.phoenix.ErrorCode configReverseLimitSwitchSource(com.ctre.phoenix.motorcontrol.RemoteLimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose, int deviceID)
Configures the reverse limit switch for a remote source.- Specified by:
configReverseLimitSwitchSource
in interfaceChickenController
- Overrides:
configReverseLimitSwitchSource
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
type
- Remote limit switch source. @see #LimitSwitchSourcenormalOpenOrClose
- Setting for normally open or normally closed.deviceID
- Device ID of remote source.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configReverseSoftLimitEnable
public com.ctre.phoenix.ErrorCode configReverseSoftLimitEnable(boolean enable)
Configures the reverse soft limit enable.- Specified by:
configReverseSoftLimitEnable
in interfaceChickenController
- Overrides:
configReverseSoftLimitEnable
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
enable
- Reverse Sensor Position Limit Enable.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configReverseSoftLimitThreshold
public com.ctre.phoenix.ErrorCode configReverseSoftLimitThreshold(int reverseSensorLimit)
Configures the reverse soft limit threshold.- Specified by:
configReverseSoftLimitThreshold
in interfaceChickenController
- Overrides:
configReverseSoftLimitThreshold
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
reverseSensorLimit
- Reverse Sensor Position Limit (in Raw Sensor Units).- Returns:
- Error Code generated by function. 0 indicates no error.
-
configSelectedFeedbackSensor
public com.ctre.phoenix.ErrorCode configSelectedFeedbackSensor(com.ctre.phoenix.motorcontrol.RemoteFeedbackDevice feedbackDevice, int pidIdx)
Select the remote feedback device for the motor controller.- Specified by:
configSelectedFeedbackSensor
in interfaceChickenController
- Parameters:
feedbackDevice
- Remote Feedback Device to select.pidIdx
- 0 for Primary closed-loop. 1 for cascaded closed-loop.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configSelectedFeedbackSensor
public com.ctre.phoenix.ErrorCode configSelectedFeedbackSensor(com.ctre.phoenix.motorcontrol.RemoteFeedbackDevice feedbackDevice)
Select the remote feedback device for the motor controller.- Specified by:
configSelectedFeedbackSensor
in interfaceChickenController
- Overrides:
configSelectedFeedbackSensor
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
feedbackDevice
- Remote Feedback Device to select.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configSelectedFeedbackSensor
public com.ctre.phoenix.ErrorCode configSelectedFeedbackSensor(com.ctre.phoenix.motorcontrol.FeedbackDevice feedbackDevice, int pidIdx)
Select the feedback device for the motor controller.- Specified by:
configSelectedFeedbackSensor
in interfaceChickenController
- Parameters:
feedbackDevice
- Feedback Device to select.pidIdx
- The PID IDX to use.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configSelectedFeedbackSensor
public com.ctre.phoenix.ErrorCode configSelectedFeedbackSensor(com.ctre.phoenix.motorcontrol.FeedbackDevice feedbackDevice)
Select the feedback device for the motor controller.- Specified by:
configSelectedFeedbackSensor
in interfaceChickenController
- Overrides:
configSelectedFeedbackSensor
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
feedbackDevice
- Feedback Device to select.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configSensorTerm
public com.ctre.phoenix.ErrorCode configSensorTerm(com.ctre.phoenix.motorcontrol.SensorTerm sensorTerm, com.ctre.phoenix.motorcontrol.FeedbackDevice feedbackDevice)
- Specified by:
configSensorTerm
in interfaceChickenController
- Overrides:
configSensorTerm
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
-
configSetCustomParam
public com.ctre.phoenix.ErrorCode configSetCustomParam(int newValue, int paramIndex)
Sets the value of a custom parameter.- Specified by:
configSetCustomParam
in interfaceChickenController
- Overrides:
configSetCustomParam
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
newValue
- Value for custom parameter.paramIndex
- Index of custom parameter.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configSetParameter
public com.ctre.phoenix.ErrorCode configSetParameter(com.ctre.phoenix.ParamEnum param, double value, int subValue, int ordinal)
Sets a parameter.- Specified by:
configSetParameter
in interfaceChickenController
- Overrides:
configSetParameter
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
param
- Parameter enumeration.value
- Value of parameter.subValue
- Subvalue for parameter. Maximum value of 255.ordinal
- Ordinal of parameter.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configSetParameter
public com.ctre.phoenix.ErrorCode configSetParameter(int param, double value, int subValue, int ordinal)
Sets a parameter.- Specified by:
configSetParameter
in interfaceChickenController
- Overrides:
configSetParameter
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
param
- Parameter enumeration.value
- Value of parameter.subValue
- Subvalue for parameter. Maximum value of 255.ordinal
- Ordinal of parameter.- Returns:
- Error Code generated by function. 0 indicates no error.
-
configVelocityMeasurementPeriod
public com.ctre.phoenix.ErrorCode configVelocityMeasurementPeriod(int period)
Sets the period over which velocity measurements are taken.- Specified by:
configVelocityMeasurementPeriod
in interfaceChickenController
- Parameters:
period
- Desired period for the velocity measurement. @see #VelocityMeasPeriod- Returns:
- Error Code generated by function. 0 indicates no error.
-
configVelocityMeasurementWindow
public com.ctre.phoenix.ErrorCode configVelocityMeasurementWindow(int windowSize)
- Specified by:
configVelocityMeasurementWindow
in interfaceChickenController
- Overrides:
configVelocityMeasurementWindow
in classcom.ctre.phoenix.motorcontrol.can.BaseTalon
-
configVoltageCompSaturation
public com.ctre.phoenix.ErrorCode configVoltageCompSaturation(double voltage)
Configures the Voltage Compensation saturation voltage.- Specified by:
configVoltageCompSaturation
in interfaceChickenController
- Overrides:
configVoltageCompSaturation
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
voltage
- TO-DO: Comment me!- Returns:
- Error Code generated by function. 0 indicates no error.
-
configVoltageMeasurementFilter
public com.ctre.phoenix.ErrorCode configVoltageMeasurementFilter(int filterWindowSamples)
Configures the voltage measurement filter.- Specified by:
configVoltageMeasurementFilter
in interfaceChickenController
- Overrides:
configVoltageMeasurementFilter
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
filterWindowSamples
- Number of samples in the rolling average of voltage measurement.- Returns:
- Error Code generated by function. 0 indicates no error.
-
config_IntegralZone
public com.ctre.phoenix.ErrorCode config_IntegralZone(int slotIdx, int izone)
Sets the Integral Zone constant in the given parameter slot.- Specified by:
config_IntegralZone
in interfaceChickenController
- Overrides:
config_IntegralZone
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
slotIdx
- Parameter slot for the constant.izone
- Value of the Integral Zone constant.- Returns:
- Error Code generated by function. 0 indicates no error.
-
config_kD
public com.ctre.phoenix.ErrorCode config_kD(int slotIdx, double value)
Sets the 'D' constant in the given parameter slot.- Specified by:
config_kD
in interfaceChickenController
- Overrides:
config_kD
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
slotIdx
- Parameter slot for the constant.value
- Value of the D constant.- Returns:
- Error Code generated by function. 0 indicates no error.
-
config_kF
public com.ctre.phoenix.ErrorCode config_kF(int slotIdx, double value)
Sets the 'F' constant in the given parameter slot.- Specified by:
config_kF
in interfaceChickenController
- Overrides:
config_kF
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
slotIdx
- Parameter slot for the constant.value
- Value of the F constant.- Returns:
- Error Code generated by function. 0 indicates no error.
-
config_kI
public com.ctre.phoenix.ErrorCode config_kI(int slotIdx, double value)
Sets the 'I' constant in the given parameter slot.- Specified by:
config_kI
in interfaceChickenController
- Overrides:
config_kI
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
slotIdx
- Parameter slot for the constant.value
- Value of the I constant.- Returns:
- Error Code generated by function. 0 indicates no error.
-
config_kP
public com.ctre.phoenix.ErrorCode config_kP(int slotIdx, double value)
Sets the 'P' constant in the given parameter slot.- Specified by:
config_kP
in interfaceChickenController
- Overrides:
config_kP
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
slotIdx
- Parameter slot for the constant.value
- Value of the P constant.- Returns:
- Error Code generated by function. 0 indicates no error.
-
getAnalogIn
public int getAnalogIn()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.- Returns:
- the 24bit analog value. The bottom ten bits is the ADC (0 - 1023) on the analog pin of the Talon. The upper 14 bits tracks the overflows and underflows (continuous sensor).
-
getAnalogInRaw
public int getAnalogInRaw()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.- Returns:
- the ADC (0 - 1023) on analog pin of the Talon.
-
getAnalogInVel
public int getAnalogInVel()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.- Returns:
- the value (0 - 1023) on the analog pin of the Talon.
-
getClosedLoopError
public int getClosedLoopError()
Gets the closed-loop error.- Specified by:
getClosedLoopError
in interfaceChickenController
- Overrides:
getClosedLoopError
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Returns:
- Closed-loop error value.
-
getControlMode
public com.ctre.phoenix.motorcontrol.ControlMode getControlMode()
Note that this does not return the currently set control mode in the talon wrapper and may be different than the control mode set usingsetControlMode(ControlMode)
.- Specified by:
getControlMode
in interfaceChickenController
- Specified by:
getControlMode
in interfacecom.ctre.phoenix.motorcontrol.IMotorController
- Overrides:
getControlMode
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Returns:
- The current control mode in the motor controller.
-
setControlMode
public void setControlMode(com.ctre.phoenix.motorcontrol.ControlMode controlMode)
- Specified by:
setControlMode
in interfaceChickenController
-
getDefaultPidIdx
public int getDefaultPidIdx()
- Specified by:
getDefaultPidIdx
in interfaceChickenController
-
setDefaultPidIdx
public void setDefaultPidIdx(int defaultPidIdx)
- Specified by:
setDefaultPidIdx
in interfaceChickenController
-
getDefaultTimeoutMs
public int getDefaultTimeoutMs()
- Specified by:
getDefaultTimeoutMs
in interfaceChickenController
-
setDefaultTimeoutMs
public void setDefaultTimeoutMs(int defaultTimeoutMs)
- Specified by:
setDefaultTimeoutMs
in interfaceChickenController
-
getEncoderCodesPerRev
@Deprecated public double getEncoderCodesPerRev()
Deprecated.This no longer has any effect as natural units functionality has been removed.Gets the encoder codes per revolution.- Specified by:
getEncoderCodesPerRev
in interfaceChickenController
- Returns:
0
.
-
setEncoderCodesPerRev
@Deprecated public void setEncoderCodesPerRev(double encoderCodesPerRev)
Deprecated.This no longer has any effect as natural units functionality has been removed.Sets the encoder codes per revolution for getting and setting velocity and position.- Specified by:
setEncoderCodesPerRev
in interfaceChickenController
- Parameters:
encoderCodesPerRev
- The encoder codes per revolution to set.
-
getErrorDerivative
public double getErrorDerivative()
Gets the derivative of the closed-loop error.- Specified by:
getErrorDerivative
in interfaceChickenController
- Overrides:
getErrorDerivative
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Returns:
- The error derivative value.
-
getIntegralAccumulator
public double getIntegralAccumulator()
Gets the iaccum value.- Specified by:
getIntegralAccumulator
in interfaceChickenController
- Overrides:
getIntegralAccumulator
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Returns:
- Integral accumulator value.
-
getPinStateQuadA
public boolean getPinStateQuadA()
Gets pin state quad a.- Returns:
- the pin state quad a.
-
getPinStateQuadB
public boolean getPinStateQuadB()
Gets pin state quad b.- Returns:
- Digital level of QUADB pin.
-
getPinStateQuadIdx
public boolean getPinStateQuadIdx()
Gets pin state quad index.- Returns:
- Digital level of QUAD Index pin.
-
getPulseWidthPosition
public int getPulseWidthPosition()
Gets pulse width position.- Returns:
- the pulse width position.
-
getPulseWidthRiseToFallUs
public int getPulseWidthRiseToFallUs()
Gets pulse width rise to fall us.- Returns:
- the pulse width rise to fall us.
-
getPulseWidthRiseToRiseUs
public int getPulseWidthRiseToRiseUs()
Gets pulse width rise to rise us.- Returns:
- the pulse width rise to rise us.
-
getPulseWidthVelocity
public int getPulseWidthVelocity()
Gets pulse width velocity.- Returns:
- the pulse width velocity.
-
getQuadraturePosition
public int getQuadraturePosition()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.- Returns:
- the Error code of the request.
-
getQuadratureVelocity
public int getQuadratureVelocity()
Get the position of whatever is in the analog pin of the Talon, regardless of whether it is actually being used for feedback.- Returns:
- the value (0 - 1023) on the analog pin of the Talon.
-
getSelectedSensorPosition
public int getSelectedSensorPosition()
Get the selected sensor position.- Specified by:
getSelectedSensorPosition
in interfaceChickenController
- Overrides:
getSelectedSensorPosition
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Returns:
- Position of selected sensor in raw sensor units per decisecond.
-
getSelectedSensorVelocity
public int getSelectedSensorVelocity()
Get the selected sensor velocity.- Specified by:
getSelectedSensorVelocity
in interfaceChickenController
- Overrides:
getSelectedSensorVelocity
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Returns:
- Velocity of selected sensor in raw sensor units per decisecond.
-
getStatusFramePeriod
public int getStatusFramePeriod(com.ctre.phoenix.motorcontrol.StatusFrameEnhanced frame)
- Specified by:
getStatusFramePeriod
in interfaceChickenController
- Overrides:
getStatusFramePeriod
in classcom.ctre.phoenix.motorcontrol.can.BaseTalon
-
getStatusFramePeriod
public int getStatusFramePeriod(int frame)
Gets the period of the given status frame.- Specified by:
getStatusFramePeriod
in interfaceChickenController
- Overrides:
getStatusFramePeriod
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
frame
- Frame to get the period of.- Returns:
- Period of the given status frame.
-
getStatusFramePeriod
public int getStatusFramePeriod(com.ctre.phoenix.motorcontrol.StatusFrame frame)
Gets the period of the given status frame.- Specified by:
getStatusFramePeriod
in interfaceChickenController
- Overrides:
getStatusFramePeriod
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
frame
- Frame to get the period of.- Returns:
- Period of the given status frame.
-
selectProfileSlot
public void selectProfileSlot(int slotIdx)
Selects which profile slot to use for closed-loop control.- Specified by:
selectProfileSlot
in interfaceChickenController
- Parameters:
slotIdx
- Profile slot to select.
-
set
public void set(double outputValue)
Sets the appropriate output on the talon, depending on the mode.In PercentOutput, the output is between -1.0 and 1.0, with 0.0 as stopped. In Voltage mode, output value is in volts. In Current mode, output value is in amperes. In Speed mode, output value is in position change / 100ms. In Position mode, output value is in native sensor units. In Velocity mode, output value is in native units per decisecond. In Follower mode, the output value is the integer device ID of the talon to duplicate.
- Specified by:
set
in interfaceChickenController
- Parameters:
outputValue
- The setpoint value, as described above.
-
setAnalogPosition
public com.ctre.phoenix.ErrorCode setAnalogPosition(int newPosition)
Sets analog position.- Parameters:
newPosition
- The new position.- Returns:
- an ErrorCode.
-
setBrake
public void setBrake(boolean brake)
Sets the mode of operation during neutral throttle output.- Specified by:
setBrake
in interfaceChickenController
- Parameters:
brake
- Whether or not to brake.
-
setIntegralAccumulator
public com.ctre.phoenix.ErrorCode setIntegralAccumulator(double iaccum, int pidIdx)
Sets the integral accumulator.- Specified by:
setIntegralAccumulator
in interfaceChickenController
- Parameters:
iaccum
- Value to set for the integral accumulator.pidIdx
- The PID IDX to use.- Returns:
- Error Code generated by function. 0 indicates no error.
-
setIntegralAccumulator
public com.ctre.phoenix.ErrorCode setIntegralAccumulator(double iaccum)
Sets the integral accumulator.- Specified by:
setIntegralAccumulator
in interfaceChickenController
- Overrides:
setIntegralAccumulator
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
iaccum
- Value to set for the integral accumulator.- Returns:
- Error Code generated by function. 0 indicates no error.
-
setPulseWidthPosition
public com.ctre.phoenix.ErrorCode setPulseWidthPosition(int newPosition)
Sets pulse width position.- Parameters:
newPosition
- The position value to apply to the sensor.- Returns:
- an ErrErrorCode
-
setQuadraturePosition
public com.ctre.phoenix.ErrorCode setQuadraturePosition(int newPosition)
Change the quadrature reported position. Typically this is used to "zero" the sensor. This only works with Quadrature sensor. To set the selected sensor position regardless of what type it is, see SetSelectedSensorPosition in the motor controller class.- Parameters:
newPosition
- The position value to apply to the sensor.- Returns:
- error code.
-
setSelectedSensorPosition
public com.ctre.phoenix.ErrorCode setSelectedSensorPosition(int sensorPos, int pidIdx)
Sets the sensor position to the given value.- Specified by:
setSelectedSensorPosition
in interfaceChickenController
- Parameters:
sensorPos
- Position to set for the selected sensor (in Raw Sensor Units).pidIdx
- The PID IDX to use.- Returns:
- Error Code generated by function. 0 indicates no error.
-
setSelectedSensorPosition
public com.ctre.phoenix.ErrorCode setSelectedSensorPosition(int sensorPos)
Sets the sensor position to the given value.- Specified by:
setSelectedSensorPosition
in interfaceChickenController
- Overrides:
setSelectedSensorPosition
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
sensorPos
- Position to set for the selected sensor (in Raw Sensor Units).- Returns:
- Error Code generated by function. 0 indicates no error.
-
setStatusFramePeriod
public com.ctre.phoenix.ErrorCode setStatusFramePeriod(com.ctre.phoenix.motorcontrol.StatusFrameEnhanced frame, int periodMs)
- Overrides:
setStatusFramePeriod
in classcom.ctre.phoenix.motorcontrol.can.BaseTalon
-
setStatusFramePeriod
public com.ctre.phoenix.ErrorCode setStatusFramePeriod(int frameValue, int periodMs)
Sets the period of the given status frame.- Specified by:
setStatusFramePeriod
in interfaceChickenController
- Overrides:
setStatusFramePeriod
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
periodMs
- Period in ms for the given frame.frameValue
- Frame whose period is to be changed.- Returns:
- Error Code generated by function. 0 indicates no error.
-
setStatusFramePeriod
public com.ctre.phoenix.ErrorCode setStatusFramePeriod(com.ctre.phoenix.motorcontrol.StatusFrame frame, int periodMs)
Sets the period of the given status frame.- Specified by:
setStatusFramePeriod
in interfaceChickenController
- Overrides:
setStatusFramePeriod
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
frame
- Frame whose period is to be changed.periodMs
- Period in ms for the given frame.- Returns:
- Error Code generated by function. 0 indicates no error.
-
setControlMode
@Deprecated public void setControlMode(int mode)
Deprecated.
-
changeControlMode
@Deprecated public void changeControlMode(ChickenTalon.TalonControlMode controlMode)
Deprecated.
-
setPID
@Deprecated public void setPID(double p, double i, double d)
Deprecated.
-
setP
@Deprecated public void setP(double p)
Deprecated.Set the proportional value of the currently selected profile.- Parameters:
p
- Proportional constant for the currently selected PID profile.
-
setI
@Deprecated public void setI(double i)
Deprecated.Set the integration constant of the currently selected profile.- Parameters:
i
- Integration constant for the currently selected PID profile.
-
setD
@Deprecated public void setD(double d)
Deprecated.Set the derivative constant of the currently selected profile.- Parameters:
d
- Derivative constant for the currently selected PID profile.
-
setF
@Deprecated public void setF(double f)
Deprecated.UseBaseMotorController.config_kF(int, double, int)
Set the feedforward value of the currently selected profile.- Parameters:
f
- Feedforward constant for the currently selected PID profile.
-
enableBrakeMode
@Deprecated public void enableBrakeMode(boolean brake)
Deprecated.
-
configEncoderCodesPerRev
@Deprecated public void configEncoderCodesPerRev(int codesPerRev)
Deprecated.Functionality removed.Configure how many codes per revolution are generated by your encoder.- Parameters:
codesPerRev
- The number of counts per revolution.
-
getPosition
@Deprecated public double getPosition()
Deprecated.When using analog sensors, 0 units corresponds to 0V, 1023 units corresponds to 3.3V. When using an analog encoder (wrapping around 1023 to 0 is possible) the units are still 3.3V per 1023 units. When using quadrature, each unit is a quadrature edge (4X) mode.- Returns:
- The position of the sensor currently providing feedback.
-
setPosition
@Deprecated public void setPosition(double pos)
Deprecated.
-
setFeedbackDevice
@Deprecated public void setFeedbackDevice(com.ctre.phoenix.motorcontrol.FeedbackDevice device)
Deprecated.
-
setVoltageRampRate
@Deprecated public void setVoltageRampRate(double rampRate)
Deprecated.Set the voltage ramp rate for the current profile. Limits the rate at which the throttle will change. Affects all modes.
-
setProfile
@Deprecated public void setProfile(int profile)
Deprecated.Select which closed loop profile to use, and uses whatever PIDF gains and the such that are already there.
-
getEncPosition
@Deprecated public int getEncPosition()
Deprecated.Get the current encoder position, regardless of whether it is the current feedback device.
-
getEncVelocity
@Deprecated public int getEncVelocity()
Deprecated.Get the current encoder velocity, regardless of whether it is the current feedback device.
-
getError
@Deprecated public double getError()
Deprecated.Returns the difference between the setpoint and the current position.- Returns:
- The error in units corresponding to whichever mode we are in.
-
reverseOutput
@Deprecated public void reverseOutput(boolean flip)
Deprecated.UseBaseMotorController.setInverted(boolean)
Flips the sign (multiplies by negative one) the throttle values going into the motor on the talon in closed loop modes.- Parameters:
flip
- True if motor output should be flipped; False if not.
-
reverseSensor
@Deprecated public void reverseSensor(boolean flip)
Deprecated.UseBaseMotorController.setSensorPhase(boolean)
Flips the sign (multiplies by negative one) the sensor values going into the talon. This only affects position and velocity closed loop control. Allows for situations where you may have a sensor flipped and going in the wrong direction.- Parameters:
flip
- True if sensor input should be flipped; False if not.
-
configNominalOutputVoltage
@Deprecated public void configNominalOutputVoltage(double forwardVoltage, double reverseVoltage)
Deprecated.
-
getSetpoint
@Deprecated public double getSetpoint()
Deprecated.UseBaseMotorController.getClosedLoopTarget(int)
- Returns:
- The latest value set using set().
-
setSetpoint
@Deprecated public void setSetpoint(double setpoint)
Deprecated.Useset(double)
Calls set(double).
-
configPeakOutputVoltage
@Deprecated public void configPeakOutputVoltage(double forwardVoltage, double reverseVoltage)
Deprecated.
-
getOutputVoltage
@Deprecated public double getOutputVoltage()
Deprecated.UseBaseMotorController.getMotorOutputVoltage()
- Returns:
- The voltage being output by the Talon, in Volts.
-
getSpeed
@Deprecated public double getSpeed()
Deprecated.The speed units will be in the sensor's native ticks per 100ms. For analog sensors, 3.3V corresponds to 1023 units. So a speed of 200 equates to ~0.645 dV per 100ms or 6.451 dV per second. If this is an analog encoder, that likely means 1.9548 rotations per sec. For quadrature encoders, each unit corresponds a quadrature edge (4X). So a 250 count encoder will produce 1000 edge events per rotation. An example speed of 200 would then equate to 20% of a rotation per 100ms, or 10 rotations per second.- Returns:
- The speed of the sensor currently providing feedback.
-
-