Package yams.motorcontrollers.local
Class NovaWrapper
java.lang.Object
yams.motorcontrollers.SmartMotorController
yams.motorcontrollers.local.NovaWrapper
public class NovaWrapper
extends yams.motorcontrollers.SmartMotorController
Nova wrapper for
SmartMotorController-
Nested Class Summary
Nested classes/interfaces inherited from class yams.motorcontrollers.SmartMotorController
yams.motorcontrollers.SmartMotorController.ClosedLoopControllerSlot -
Field Summary
Fields inherited from class yams.motorcontrollers.SmartMotorController
m_closedLoopControllerThread, m_config, m_expoProfile, m_expoState, m_looseFollowers, m_lqr, m_pid, m_simSupplier, m_slot, m_trapezoidProfile, m_trapState, parentTable, setpointPosition, setpointVelocity, telemetry, telemetryConfig, telemetryTable, tuningTable -
Constructor Summary
ConstructorsConstructorDescriptionNovaWrapper(com.thethriftybot.devices.ThriftyNova controller, DCMotor motor, yams.motorcontrollers.SmartMotorControllerConfig config) Construct the Nova Wrapper for the genericSmartMotorController. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyConfig(yams.motorcontrollers.SmartMotorControllerConfig config) yams.motorcontrollers.SmartMotorControllerConfigdoublePair<Optional<List<yams.telemetry.SmartMotorControllerTelemetry.BooleanTelemetryField>>,Optional<List<yams.telemetry.SmartMotorControllerTelemetry.DoubleTelemetryField>>> voidvoidsetClosedLoopRampRate(Time rampRate) voidsetClosedLoopSlot(yams.motorcontrollers.SmartMotorController.ClosedLoopControllerSlot slot) voidsetDutyCycle(double dutyCycle) voidsetEncoderInverted(boolean inverted) voidsetEncoderPosition(Angle angle) voidsetEncoderPosition(Distance distance) voidsetEncoderVelocity(AngularVelocity velocity) voidsetEncoderVelocity(LinearVelocity velocity) voidsetExponentialProfile(OptionalDouble kV, OptionalDouble kA, Optional<Voltage> maxInput) voidsetFeedback(double kP, double kI, double kD) voidsetFeedforward(double kS, double kV, double kA, double kG) voidsetIdleMode(yams.motorcontrollers.SmartMotorControllerConfig.MotorMode mode) voidsetKa(double kA) voidsetKd(double kD) voidsetKg(double kG) voidsetKi(double kI) voidsetKp(double kP) voidsetKs(double kS) voidsetKv(double kV) voidsetMeasurementLowerLimit(Distance lowerLimit) voidsetMeasurementUpperLimit(Distance upperLimit) voidsetMechanismCircumference(Distance circumference) voidsetMechanismGearing(yams.gearing.MechanismGearing gearing) voidsetMechanismLimits(Angle lower, Angle upper) voidsetMechanismLimitsEnabled(boolean enabled) voidsetMechanismLowerLimit(Angle lowerLimit) voidsetMechanismUpperLimit(Angle upperLimit) voidsetMotionProfileMaxAcceleration(AngularAcceleration maxAcceleration) voidsetMotionProfileMaxAcceleration(LinearAcceleration maxAcceleration) voidvoidsetMotionProfileMaxVelocity(AngularVelocity maxVelocity) voidsetMotionProfileMaxVelocity(LinearVelocity maxVelocity) voidsetMotorInverted(boolean inverted) voidsetOpenLoopRampRate(Time rampRate) Deprecated.voidsetPosition(Angle angle) voidsetPosition(Distance distance) voidsetStatorCurrentLimit(Current currentLimit) voidsetSupplyCurrentLimit(Current currentLimit) voidvoidsetVelocity(AngularVelocity angularVelocity) voidsetVelocity(LinearVelocity velocity) voidsetVoltage(Voltage voltage) voidvoidMethods inherited from class yams.motorcontrollers.SmartMotorController
checkConfigSafety, close, create, getClosedLoopControllerSlot, getExponentialProfileState, getMechanismPositionSetpoint, getMechanismSetpointVelocity, getName, getSimSupplier, getTrapezoidalProfileState, isMotor, iterateClosedLoopController, setSimSupplier, setupTelemetry, setupTelemetry, startClosedLoopController, stopClosedLoopController, toString, updateTelemetry
-
Constructor Details
-
NovaWrapper
public NovaWrapper(com.thethriftybot.devices.ThriftyNova controller, DCMotor motor, yams.motorcontrollers.SmartMotorControllerConfig config) Construct the Nova Wrapper for the genericSmartMotorController.- Parameters:
controller-ThriftyNovato use.motor-DCMotorconnected to theThriftyNova.config-SmartMotorControllerConfigto apply to theThriftyNova.
-
-
Method Details
-
setupSimulation
public void setupSimulation()- Specified by:
setupSimulationin classyams.motorcontrollers.SmartMotorController
-
seedRelativeEncoder
public void seedRelativeEncoder()- Specified by:
seedRelativeEncoderin classyams.motorcontrollers.SmartMotorController
-
synchronizeRelativeEncoder
public void synchronizeRelativeEncoder()- Specified by:
synchronizeRelativeEncoderin classyams.motorcontrollers.SmartMotorController
-
simIterate
public void simIterate()- Specified by:
simIteratein classyams.motorcontrollers.SmartMotorController
-
setIdleMode
public void setIdleMode(yams.motorcontrollers.SmartMotorControllerConfig.MotorMode mode) - Specified by:
setIdleModein classyams.motorcontrollers.SmartMotorController
-
setEncoderVelocity
- Specified by:
setEncoderVelocityin classyams.motorcontrollers.SmartMotorController
-
setEncoderVelocity
- Specified by:
setEncoderVelocityin classyams.motorcontrollers.SmartMotorController
-
setEncoderPosition
- Specified by:
setEncoderPositionin classyams.motorcontrollers.SmartMotorController
-
setEncoderPosition
- Specified by:
setEncoderPositionin classyams.motorcontrollers.SmartMotorController
-
setPosition
- Specified by:
setPositionin classyams.motorcontrollers.SmartMotorController
-
setPosition
- Specified by:
setPositionin classyams.motorcontrollers.SmartMotorController
-
setVelocity
- Specified by:
setVelocityin classyams.motorcontrollers.SmartMotorController
-
setVelocity
- Specified by:
setVelocityin classyams.motorcontrollers.SmartMotorController
-
applyConfig
public boolean applyConfig(yams.motorcontrollers.SmartMotorControllerConfig config) - Specified by:
applyConfigin classyams.motorcontrollers.SmartMotorController
-
getDutyCycle
public double getDutyCycle()- Specified by:
getDutyCyclein classyams.motorcontrollers.SmartMotorController
-
setDutyCycle
public void setDutyCycle(double dutyCycle) - Specified by:
setDutyCyclein classyams.motorcontrollers.SmartMotorController
-
getSupplyCurrent
- Specified by:
getSupplyCurrentin classyams.motorcontrollers.SmartMotorController
-
getStatorCurrent
- Specified by:
getStatorCurrentin classyams.motorcontrollers.SmartMotorController
-
getVoltage
- Specified by:
getVoltagein classyams.motorcontrollers.SmartMotorController
-
setVoltage
- Specified by:
setVoltagein classyams.motorcontrollers.SmartMotorController
-
getDCMotor
- Specified by:
getDCMotorin classyams.motorcontrollers.SmartMotorController
-
getMeasurementVelocity
- Specified by:
getMeasurementVelocityin classyams.motorcontrollers.SmartMotorController
-
getMeasurementPosition
- Specified by:
getMeasurementPositionin classyams.motorcontrollers.SmartMotorController
-
getMeasurementAcceleration
- Specified by:
getMeasurementAccelerationin classyams.motorcontrollers.SmartMotorController
-
getMechanismVelocity
- Specified by:
getMechanismVelocityin classyams.motorcontrollers.SmartMotorController
-
getMechanismAcceleration
- Specified by:
getMechanismAccelerationin classyams.motorcontrollers.SmartMotorController
-
getMechanismPosition
- Specified by:
getMechanismPositionin classyams.motorcontrollers.SmartMotorController
-
getRotorVelocity
- Specified by:
getRotorVelocityin classyams.motorcontrollers.SmartMotorController
-
getRotorPosition
- Specified by:
getRotorPositionin classyams.motorcontrollers.SmartMotorController
-
getExternalEncoderPosition
- Specified by:
getExternalEncoderPositionin classyams.motorcontrollers.SmartMotorController
-
getExternalEncoderVelocity
- Specified by:
getExternalEncoderVelocityin classyams.motorcontrollers.SmartMotorController
-
setMotorInverted
public void setMotorInverted(boolean inverted) - Specified by:
setMotorInvertedin classyams.motorcontrollers.SmartMotorController
-
setEncoderInverted
public void setEncoderInverted(boolean inverted) - Specified by:
setEncoderInvertedin classyams.motorcontrollers.SmartMotorController
-
setMotionProfileMaxVelocity
- Specified by:
setMotionProfileMaxVelocityin classyams.motorcontrollers.SmartMotorController
-
setMotionProfileMaxAcceleration
- Specified by:
setMotionProfileMaxAccelerationin classyams.motorcontrollers.SmartMotorController
-
setMotionProfileMaxVelocity
- Specified by:
setMotionProfileMaxVelocityin classyams.motorcontrollers.SmartMotorController
-
setMotionProfileMaxAcceleration
- Specified by:
setMotionProfileMaxAccelerationin classyams.motorcontrollers.SmartMotorController
-
setMotionProfileMaxJerk
- Specified by:
setMotionProfileMaxJerkin classyams.motorcontrollers.SmartMotorController
-
setExponentialProfile
- Specified by:
setExponentialProfilein classyams.motorcontrollers.SmartMotorController
-
setKp
public void setKp(double kP) - Specified by:
setKpin classyams.motorcontrollers.SmartMotorController
-
setKi
public void setKi(double kI) - Specified by:
setKiin classyams.motorcontrollers.SmartMotorController
-
setKd
public void setKd(double kD) - Specified by:
setKdin classyams.motorcontrollers.SmartMotorController
-
setFeedback
public void setFeedback(double kP, double kI, double kD) - Specified by:
setFeedbackin classyams.motorcontrollers.SmartMotorController
-
setKs
public void setKs(double kS) - Specified by:
setKsin classyams.motorcontrollers.SmartMotorController
-
setKv
public void setKv(double kV) - Specified by:
setKvin classyams.motorcontrollers.SmartMotorController
-
setKa
public void setKa(double kA) - Specified by:
setKain classyams.motorcontrollers.SmartMotorController
-
setKg
public void setKg(double kG) - Specified by:
setKgin classyams.motorcontrollers.SmartMotorController
-
setFeedforward
public void setFeedforward(double kS, double kV, double kA, double kG) - Specified by:
setFeedforwardin classyams.motorcontrollers.SmartMotorController
-
setStatorCurrentLimit
- Specified by:
setStatorCurrentLimitin classyams.motorcontrollers.SmartMotorController
-
setSupplyCurrentLimit
- Specified by:
setSupplyCurrentLimitin classyams.motorcontrollers.SmartMotorController
-
setClosedLoopRampRate
- Specified by:
setClosedLoopRampRatein classyams.motorcontrollers.SmartMotorController
-
setOpenLoopRampRate
Deprecated.- Specified by:
setOpenLoopRampRatein classyams.motorcontrollers.SmartMotorController
-
setMeasurementUpperLimit
- Specified by:
setMeasurementUpperLimitin classyams.motorcontrollers.SmartMotorController
-
setMeasurementLowerLimit
- Specified by:
setMeasurementLowerLimitin classyams.motorcontrollers.SmartMotorController
-
setMechanismUpperLimit
- Specified by:
setMechanismUpperLimitin classyams.motorcontrollers.SmartMotorController
-
setMechanismLowerLimit
- Specified by:
setMechanismLowerLimitin classyams.motorcontrollers.SmartMotorController
-
setMechanismLimits
- Specified by:
setMechanismLimitsin classyams.motorcontrollers.SmartMotorController
-
setMechanismLimitsEnabled
public void setMechanismLimitsEnabled(boolean enabled) - Specified by:
setMechanismLimitsEnabledin classyams.motorcontrollers.SmartMotorController
-
setClosedLoopSlot
public void setClosedLoopSlot(yams.motorcontrollers.SmartMotorController.ClosedLoopControllerSlot slot) - Specified by:
setClosedLoopSlotin classyams.motorcontrollers.SmartMotorController
-
getTemperature
- Specified by:
getTemperaturein classyams.motorcontrollers.SmartMotorController
-
getConfig
public yams.motorcontrollers.SmartMotorControllerConfig getConfig()- Specified by:
getConfigin classyams.motorcontrollers.SmartMotorController
-
getMotorController
- Specified by:
getMotorControllerin classyams.motorcontrollers.SmartMotorController
-
getMotorControllerConfig
- Specified by:
getMotorControllerConfigin classyams.motorcontrollers.SmartMotorController
-
getUnsupportedTelemetryFields
public Pair<Optional<List<yams.telemetry.SmartMotorControllerTelemetry.BooleanTelemetryField>>,Optional<List<yams.telemetry.SmartMotorControllerTelemetry.DoubleTelemetryField>>> getUnsupportedTelemetryFields()- Specified by:
getUnsupportedTelemetryFieldsin classyams.motorcontrollers.SmartMotorController
-
setMechanismGearing
public void setMechanismGearing(yams.gearing.MechanismGearing gearing) - Specified by:
setMechanismGearingin classyams.motorcontrollers.SmartMotorController
-
setMechanismCircumference
- Specified by:
setMechanismCircumferencein classyams.motorcontrollers.SmartMotorController
-