Class CANTalonFxWpiAdapter
java.lang.Object
xbot.common.controls.actuators.XCANMotorController
xbot.common.controls.actuators.wpi_adapters.CANTalonFxWpiAdapter
- All Implemented Interfaces:
DataFrameRefreshable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class xbot.common.controls.actuators.XCANMotorController
XCANMotorController.MotorPidMode, XCANMotorController.XCANMotorControllerFactory -
Field Summary
Fields inherited from class xbot.common.controls.actuators.XCANMotorController
akitName, busId, deviceId, firstPeriodicCall, inputs, kDProp, kGravityFFProp, kIProp, kMaxOutputProp, kMinOutputProp, kPProp, kVelocityFFProp, MAX_VOLTAGE, propertyFactory, softwareForwardLimit, softwareReverseLimit, usesPropertySystem -
Constructor Summary
ConstructorsConstructorDescriptionCANTalonFxWpiAdapter(CANMotorControllerInfo info, String owningSystemPrefix, PropertyFactory propertyFactory, DevicePolice police, String pidPropertyPrefix, XCANMotorControllerPIDProperties defaultPIDProperties) -
Method Summary
Modifier and TypeMethodDescriptionReturns the internal TalonFX object.doublegetPower()booleanvoidsetClosedLoopRampRates(Time dutyCyclePeriod, Time voltagePeriod) voidsetConfiguration(CANMotorControllerOutputConfig outputConfig) voidsetEnableMusicDuringDisable(boolean enabled) voidsetOpenLoopRampRates(Time dutyCyclePeriod, Time voltagePeriod) voidsetPidDirectly(double p, double i, double d, double velocityFF, double gravityFF, int slot) voidsetPositionAndVelocityUpdateFrequency(Frequency frequency) voidsetPower(double power) voidsetPowerRange(double minPower, double maxPower) voidsetRawPosition(Angle position) Override the position of the motor controller.voidsetRawPositionTarget(Angle rawPosition, XCANMotorController.MotorPidMode mode, int slot) Set the target position for the motor controller.voidsetRawVelocityTarget(AngularVelocity rawVelocity, XCANMotorController.MotorPidMode mode, int slot) Set the target velocity for the motor controller.voidsetTrapezoidalProfileAcceleration(AngularAcceleration acceleration) voidvoidvoidsetVoltage(Voltage voltage) voidsetVoltageRange(Voltage minVoltage, Voltage maxVoltage) protected voidMethods inherited from class xbot.common.controls.actuators.XCANMotorController
convertDistanceToRawAngle, convertRawAngleToDistance, convertRawAngleToScaledAngle, convertRawVelocityToScaledVelocity, convertScaledAngleToRawAngle, convertScaledVelocityToRawVelocity, getCurrent, getPosition, getPositionAsDistance, getRawPosition, getRawVelocity, getVelocity, getVoltage, isValidPowerRequest, isValidVoltageRequest, periodic, refreshDataFrame, setAngleScaleFactor, setDistancePerMotorRotationsScaleFactor, setPidDirectly, setPidDirectly, setPosition, setPositionTarget, setPositionTarget, setPositionTarget, setRawPositionTarget, setRawPositionTarget, setRawVelocityTarget, setRawVelocityTarget, setSoftwareForwardLimit, setSoftwareReverseLimit, setVelocityTarget, setVelocityTarget, setVelocityTarget
-
Constructor Details
-
CANTalonFxWpiAdapter
@AssistedInject public CANTalonFxWpiAdapter(@Assisted("info") CANMotorControllerInfo info, @Assisted("owningSystemPrefix") String owningSystemPrefix, PropertyFactory propertyFactory, DevicePolice police, @Assisted("pidPropertyPrefix") String pidPropertyPrefix, @Assisted("defaultPIDProperties") XCANMotorControllerPIDProperties defaultPIDProperties)
-
-
Method Details
-
setConfiguration
- Specified by:
setConfigurationin classXCANMotorController
-
setPidDirectly
public void setPidDirectly(double p, double i, double d, double velocityFF, double gravityFF, int slot) - Specified by:
setPidDirectlyin classXCANMotorController
-
getHealth
- Specified by:
getHealthin classXCANMotorController
-
setOpenLoopRampRates
- Specified by:
setOpenLoopRampRatesin classXCANMotorController
-
setClosedLoopRampRates
- Specified by:
setClosedLoopRampRatesin classXCANMotorController
-
setTrapezoidalProfileAcceleration
- Specified by:
setTrapezoidalProfileAccelerationin classXCANMotorController
-
setTrapezoidalProfileJerk
- Specified by:
setTrapezoidalProfileJerkin classXCANMotorController
-
setTrapezoidalProfileMaxVelocity
- Specified by:
setTrapezoidalProfileMaxVelocityin classXCANMotorController
-
setPower
public void setPower(double power) - Specified by:
setPowerin classXCANMotorController
-
getPower
public double getPower()- Specified by:
getPowerin classXCANMotorController
-
setPowerRange
public void setPowerRange(double minPower, double maxPower) - Specified by:
setPowerRangein classXCANMotorController
-
getRawPosition_internal
-
setRawPosition
Description copied from class:XCANMotorControllerOverride the position of the motor controller.Typically, this would be called to zero the reported position of the motor as part of a calibration routine.
- Specified by:
setRawPositionin classXCANMotorController- Parameters:
position- The new position to set.
-
setRawPositionTarget
public void setRawPositionTarget(Angle rawPosition, XCANMotorController.MotorPidMode mode, int slot) Description copied from class:XCANMotorControllerSet the target position for the motor controller.- Specified by:
setRawPositionTargetin classXCANMotorController- Parameters:
rawPosition- The target position to set.mode- The PID mode to use when setting the target position.slot- The PID slot to use when setting the target position.
-
getRawVelocity_internal
-
setRawVelocityTarget
public void setRawVelocityTarget(AngularVelocity rawVelocity, XCANMotorController.MotorPidMode mode, int slot) Description copied from class:XCANMotorControllerSet the target velocity for the motor controller.- Specified by:
setRawVelocityTargetin classXCANMotorController- Parameters:
rawVelocity- The target velocity to set.mode- The PID mode to use when setting the target velocity.slot- The PID slot to use when setting the target velocity.
-
setVoltage
- Specified by:
setVoltagein classXCANMotorController
-
setVoltageRange
- Specified by:
setVoltageRangein classXCANMotorController
-
isInverted
public boolean isInverted()- Specified by:
isInvertedin classXCANMotorController
-
updateInputs
- Specified by:
updateInputsin classXCANMotorController
-
setPositionAndVelocityUpdateFrequency
- Specified by:
setPositionAndVelocityUpdateFrequencyin classXCANMotorController
-
setEnableMusicDuringDisable
public void setEnableMusicDuringDisable(boolean enabled) -
getInternalTalonFx
Returns the internal TalonFX object. This should not be accessed directly, but is provided for use if needed.- Returns:
- the internal TalonFX object
-