Class MockCANMotorController
java.lang.Object
xbot.common.controls.actuators.XCANMotorController
xbot.common.controls.actuators.mock_adapters.MockCANMotorController
- All Implemented Interfaces:
DataFrameRefreshable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classNested classes/interfaces inherited from class xbot.common.controls.actuators.XCANMotorController
XCANMotorController.MotorPidMode, XCANMotorController.XCANMotorControllerFactory -
Field Summary
FieldsModifier and TypeFieldDescriptiondoubledoubledoubledoubledoubledoubledoubleFields 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
ConstructorsConstructorDescriptionMockCANMotorController(CANMotorControllerInfo info, String owningSystemPrefix, PropertyFactory propertyFactory, DevicePolice police, String pidPropertyPrefix, XCANMotorControllerPIDProperties defaultPIDProperties) -
Method Summary
Modifier and TypeMethodDescriptiondoublegetPower()booleanvoidsetClosedLoopRampRates(Time dutyCyclePeriod, Time voltagePeriod) voidsetConfiguration(CANMotorControllerOutputConfig outputConfig) voidsetOpenLoopRampRates(Time dutyCyclePeriod, Time voltagePeriod) voidsetPidDirectly(double p, double i, double d, double velocityFF, double gravityFF, int slot) voidsetPositionAndVelocityUpdateFrequency(Frequency frequency) voidsetPower(double power) voidsetPowerInternal(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.voidsetRawVelocity(AngularVelocity rawVelocity) voidsetRawVelocityTarget(AngularVelocity rawVelocity, XCANMotorController.MotorPidMode mode, int slot) Set the target velocity for the motor controller.voidsetTrapezoidalProfileAcceleration(AngularAcceleration acceleration) voidvoidvoidsetVelocity(AngularVelocity velocity) voidsetVoltage(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
-
Field Details
-
p
public double p -
i
public double i -
d
public double d -
f
public double f -
g
public double g -
maxPower
public double maxPower -
minPower
public double minPower
-
-
Constructor Details
-
MockCANMotorController
@AssistedInject public MockCANMotorController(@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
-
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
-
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
-
setPower
public void setPower(double power) - Specified by:
setPowerin classXCANMotorController
-
setPowerInternal
public void setPowerInternal(double power) -
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.
-
getTargetPosition
-
getRawTargetPosition
-
getRawVelocity_internal
-
setVelocity
-
setRawVelocity
-
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.
-
getRawTargetVelocity
-
setVoltage
- Specified by:
setVoltagein classXCANMotorController
-
setVoltageRange
- Specified by:
setVoltageRangein classXCANMotorController
-
isInverted
public boolean isInverted()- Specified by:
isInvertedin classXCANMotorController
-
getControlMode
-
setPositionAndVelocityUpdateFrequency
- Specified by:
setPositionAndVelocityUpdateFrequencyin classXCANMotorController
-
updateInputs
- Specified by:
updateInputsin classXCANMotorController
-