Package org.team1540.rooster.wrappers
Class ChickenVictor
- java.lang.Object
-
- com.ctre.phoenix.motorcontrol.can.BaseMotorController
-
- com.ctre.phoenix.motorcontrol.can.VictorSPX
-
- org.team1540.rooster.wrappers.ChickenVictor
-
- All Implemented Interfaces:
com.ctre.phoenix.motorcontrol.IFollower
,com.ctre.phoenix.motorcontrol.IMotorController
,com.ctre.phoenix.signals.IInvertable
,com.ctre.phoenix.signals.IOutputSignal
,ChickenController
public class ChickenVictor extends com.ctre.phoenix.motorcontrol.can.VictorSPX implements ChickenController
-
-
Constructor Summary
Constructors Constructor Description ChickenVictor(int deviceNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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
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.com.ctre.phoenix.ErrorCode
configOpenloopRamp(double secondsFromNeutralToFull)
Configures the open-loop ramp rate of throttle output.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.com.ctre.phoenix.ErrorCode
configRemoteFeedbackFilter(int deviceID, com.ctre.phoenix.motorcontrol.RemoteSensorSource remoteSensorSource, int remoteOrdinal)
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.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 usingChickenController.setControlMode(ControlMode)
.int
getDefaultPidIdx()
int
getDefaultTimeoutMs()
double
getEncoderCodesPerRev()
Deprecated.double
getErrorDerivative()
Gets the derivative of the closed-loop error.double
getIntegralAccumulator()
Gets the iaccum value.double
getPeakOutputForward()
Gets the forward peak output percentage.double
getPeakOutputReverse()
Gets the reverse peak output percentage.int
getSelectedSensorPosition()
Get the selected sensor position.int
getSelectedSensorVelocity()
Get the selected sensor velocity.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
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.void
setBrake(boolean brake)
Sets the mode of operation during neutral throttle output.void
setControlMode(com.ctre.phoenix.motorcontrol.ControlMode controlMode)
void
setDefaultPidIdx(int defaultPidIdx)
void
setDefaultTimeoutMs(int defaultTimeoutMs)
void
setEncoderCodesPerRev(double encoderCodesPerRev)
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.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.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.StatusFrame frame, int periodMs)
Sets the period of the given status frame.-
Methods inherited from class com.ctre.phoenix.motorcontrol.can.VictorSPX
configAllSettings, configAllSettings, getAllConfigs, getAllConfigs, getPIDConfigs, getPIDConfigs
-
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, 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, configVelocityMeasurementPeriod, configVelocityMeasurementPeriod, configVelocityMeasurementWindow, 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, getOutputCurrent, getSelectedSensorPosition, getSelectedSensorVelocity, getSlotConfigs, getSlotConfigs, getStatusFramePeriod, 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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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.
-
configOpenloopRamp
public com.ctre.phoenix.ErrorCode configOpenloopRamp(double secondsFromNeutralToFull)
Description copied from interface:ChickenController
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.
-
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.BaseMotorController
-
configForwardLimitSwitchSource
public com.ctre.phoenix.ErrorCode configForwardLimitSwitchSource(com.ctre.phoenix.motorcontrol.RemoteLimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose, int deviceID)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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.
-
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.RemoteLimitSwitchSource type, com.ctre.phoenix.motorcontrol.LimitSwitchNormal normalOpenOrClose, int deviceID)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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.BaseMotorController
-
configVoltageCompSaturation
public com.ctre.phoenix.ErrorCode configVoltageCompSaturation(double voltage)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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.
-
getClosedLoopError
public int getClosedLoopError()
Description copied from interface:ChickenController
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()
Description copied from interface:ChickenController
Note that this does not return the currently set control mode in the talon wrapper and may be different than the control mode set usingChickenController.setControlMode(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.Description copied from interface:ChickenController
Gets the encoder codes per revolution.- Specified by:
getEncoderCodesPerRev
in interfaceChickenController
- Returns:
0
.
-
setEncoderCodesPerRev
@Deprecated public void setEncoderCodesPerRev(double encoderCodesPerRev)
Deprecated.Description copied from interface:ChickenController
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()
Description copied from interface:ChickenController
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()
Description copied from interface:ChickenController
Gets the iaccum value.- Specified by:
getIntegralAccumulator
in interfaceChickenController
- Overrides:
getIntegralAccumulator
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Returns:
- Integral accumulator value.
-
getSelectedSensorPosition
public int getSelectedSensorPosition()
Description copied from interface:ChickenController
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.
-
getSelectedSensorVelocity
public int getSelectedSensorVelocity()
Description copied from interface:ChickenController
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.BaseMotorController
-
getStatusFramePeriod
public int getStatusFramePeriod(int frame)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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.
-
setBrake
public void setBrake(boolean brake)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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.
-
setSelectedSensorPosition
public com.ctre.phoenix.ErrorCode setSelectedSensorPosition(int sensorPos, int pidIdx)
Description copied from interface:ChickenController
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)
Description copied from interface:ChickenController
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(int frameValue, int periodMs)
Description copied from interface:ChickenController
Sets the period of the given status frame.- Specified by:
setStatusFramePeriod
in interfaceChickenController
- Overrides:
setStatusFramePeriod
in classcom.ctre.phoenix.motorcontrol.can.BaseMotorController
- Parameters:
frameValue
- 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.
-
setStatusFramePeriod
public com.ctre.phoenix.ErrorCode setStatusFramePeriod(com.ctre.phoenix.motorcontrol.StatusFrame frame, int periodMs)
Description copied from interface:ChickenController
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.
-
-