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 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, propertyFactory, usesPropertySystem
-
Constructor Summary
ConstructorDescriptionCANTalonFxWpiAdapter
(CANMotorControllerInfo info, String owningSystemPrefix, PropertyFactory propertyFactory, DevicePolice police, String pidPropertyPrefix, XCANMotorControllerPIDProperties defaultPIDProperties) -
Method Summary
Modifier and TypeMethodDescriptionGets the current position of the motor output shaft.double
getPower()
Gets the angular velocity of the motor output shaft.boolean
void
setClosedLoopRampRates
(Time dutyCyclePeriod, Time voltagePeriod) void
setConfiguration
(CANMotorControllerOutputConfig outputConfig) void
setOpenLoopRampRates
(Time dutyCyclePeriod, Time voltagePeriod) void
setPidDirectly
(double p, double i, double d, double velocityFF, double gravityFF, int slot) void
setPosition
(Angle position) void
setPositionTarget
(Angle position, XCANMotorController.MotorPidMode mode, int slot) void
setPower
(double power) void
setPowerRange
(double minPower, double maxPower) void
setTrapezoidalProfileAcceleration
(AngularAcceleration acceleration) void
void
setVelocityTarget
(AngularVelocity velocity, XCANMotorController.MotorPidMode mode, int slot) protected void
Methods inherited from class xbot.common.controls.actuators.XCANMotorController
periodic, refreshDataFrame, setPidDirectly, setPidDirectly, setPositionTarget, 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:
setConfiguration
in classXCANMotorController
-
setPidDirectly
public void setPidDirectly(double p, double i, double d, double velocityFF, double gravityFF, int slot) - Specified by:
setPidDirectly
in classXCANMotorController
-
setOpenLoopRampRates
- Specified by:
setOpenLoopRampRates
in classXCANMotorController
-
setClosedLoopRampRates
- Specified by:
setClosedLoopRampRates
in classXCANMotorController
-
setTrapezoidalProfileAcceleration
- Specified by:
setTrapezoidalProfileAcceleration
in classXCANMotorController
-
setTrapezoidalProfileJerk
- Specified by:
setTrapezoidalProfileJerk
in classXCANMotorController
-
setPower
public void setPower(double power) - Specified by:
setPower
in classXCANMotorController
-
getPower
public double getPower()- Specified by:
getPower
in classXCANMotorController
-
setPowerRange
public void setPowerRange(double minPower, double maxPower) - Specified by:
setPowerRange
in classXCANMotorController
-
getPosition
Gets the current position of the motor output shaft.- Overrides:
getPosition
in classXCANMotorController
- Returns:
- The current position in unitless Angle
-
setPosition
- Overrides:
setPosition
in classXCANMotorController
-
setPositionTarget
- Specified by:
setPositionTarget
in classXCANMotorController
-
getVelocity
Gets the angular velocity of the motor output shaft.- Overrides:
getVelocity
in classXCANMotorController
- Returns:
- The velocity in unitless AngularVelocity
-
setVelocityTarget
public void setVelocityTarget(AngularVelocity velocity, XCANMotorController.MotorPidMode mode, int slot) - Specified by:
setVelocityTarget
in classXCANMotorController
-
getVoltage
- Overrides:
getVoltage
in classXCANMotorController
-
getCurrent
- Overrides:
getCurrent
in classXCANMotorController
-
isInverted
public boolean isInverted()- Specified by:
isInverted
in classXCANMotorController
-
updateInputs
- Specified by:
updateInputs
in classXCANMotorController
-