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 enum
static class
Nested classes/interfaces inherited from class xbot.common.controls.actuators.XCANMotorController
XCANMotorController.MotorPidMode, XCANMotorController.XCANMotorControllerFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptiondouble
double
double
double
double
double
double
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
ConstructorsConstructorDescriptionMockCANMotorController
(CANMotorControllerInfo info, String owningSystemPrefix, PropertyFactory propertyFactory, DevicePolice police, String pidPropertyPrefix, XCANMotorControllerPIDProperties defaultPIDProperties) -
Method Summary
Modifier and TypeMethodDescriptiondouble
getPower()
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
setPositionAndVelocityUpdateFrequency
(Frequency frequency) void
setPower
(double power) void
setPowerInternal
(double power) void
setPowerRange
(double minPower, double maxPower) void
setRawPosition
(Angle position) Override the position of the motor controller.void
setRawPositionTarget
(Angle rawPosition, XCANMotorController.MotorPidMode mode, int slot) Set the target position for the motor controller.void
setRawVelocity
(AngularVelocity rawVelocity) void
setRawVelocityTarget
(AngularVelocity rawVelocity, XCANMotorController.MotorPidMode mode, int slot) Set the target velocity for the motor controller.void
setTrapezoidalProfileAcceleration
(AngularAcceleration acceleration) void
void
void
setVelocity
(AngularVelocity velocity) void
setVoltage
(Voltage voltage) void
setVoltageRange
(Voltage minVoltage, Voltage maxVoltage) protected void
Methods 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:
setConfiguration
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
-
setTrapezoidalProfileMaxVelocity
- Specified by:
setTrapezoidalProfileMaxVelocity
in classXCANMotorController
-
setPidDirectly
public void setPidDirectly(double p, double i, double d, double velocityFF, double gravityFF, int slot) - Specified by:
setPidDirectly
in classXCANMotorController
-
getHealth
- Specified by:
getHealth
in classXCANMotorController
-
setPower
public void setPower(double power) - Specified by:
setPower
in classXCANMotorController
-
setPowerInternal
public void setPowerInternal(double power) -
getPower
public double getPower()- Specified by:
getPower
in classXCANMotorController
-
setPowerRange
public void setPowerRange(double minPower, double maxPower) - Specified by:
setPowerRange
in classXCANMotorController
-
getRawPosition_internal
-
setRawPosition
Description copied from class:XCANMotorController
Override 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:
setRawPosition
in classXCANMotorController
- Parameters:
position
- The new position to set.
-
setRawPositionTarget
public void setRawPositionTarget(Angle rawPosition, XCANMotorController.MotorPidMode mode, int slot) Description copied from class:XCANMotorController
Set the target position for the motor controller.- Specified by:
setRawPositionTarget
in 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:XCANMotorController
Set the target velocity for the motor controller.- Specified by:
setRawVelocityTarget
in 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:
setVoltage
in classXCANMotorController
-
setVoltageRange
- Specified by:
setVoltageRange
in classXCANMotorController
-
isInverted
public boolean isInverted()- Specified by:
isInverted
in classXCANMotorController
-
getControlMode
-
setPositionAndVelocityUpdateFrequency
- Specified by:
setPositionAndVelocityUpdateFrequency
in classXCANMotorController
-
updateInputs
- Specified by:
updateInputs
in classXCANMotorController
-