Package yams.mechanisms.velocity
Class FlyWheel
java.lang.Object
yams.mechanisms.SmartMechanism
yams.mechanisms.velocity.SmartVelocityMechanism
yams.mechanisms.velocity.FlyWheel
FlyWheel mechanism.
-
Field Summary
Fields inherited from class yams.mechanisms.velocity.SmartVelocityMechanism
mechanismLigament, mechanismRootFields inherited from class yams.mechanisms.SmartMechanism
m_mechanismWindow, m_smc, m_subsystem, m_telemetry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbetween(AngularVelocity start, AngularVelocity end) Between two velocities.getName()Get the name of the mechanism.Get the relative position of the mechanism, taking into account the relative position defined in theMechanismPositionConfig.Get theFlyWheelConfigobject for thisFlyWheelgetSpeed()Get theSmartMotorControllerMechanism velocity representing the FlyWheel.gte(AngularVelocity speed) Greater than or equal to angular velocity.isNear(AngularVelocity speed, AngularVelocity within) FlyWheel is near a speed.lte(AngularVelocity speed) Less than or equal to angular velocitymax()SmartVelocityMechanismis at max, defined by the soft limit or hard limit on theSmartVelocityMechanism.min()Minimum angle of theSmartVelocityMechanismgiven by the soft limit or hard limit of theSmartVelocityMechanism.setSpeed(AngularVelocity speed) Set the FlyWheel to the given speed.setSpeed(Supplier<AngularVelocity> speed) Set the FlyWheel to the given speed.voidIterate simsysId(Voltage maximumVoltage, Velocity<VoltageUnit> step, Time duration) Create the SysId routine and commands to run the SysId tests.voidUpdate the mechanism's telemetry.voidUpdates the angle of the mechanism ligament to match the current angle of the FlyWheel.Methods inherited from class yams.mechanisms.velocity.SmartVelocityMechanism
getMechanismLigament, getMechanismRoot, getMotorMethods inherited from class yams.mechanisms.SmartMechanism
gearbox, gearbox, gearing, gearing, getMechanismSetpoint, getMechanismWindow, getMotorController, set, set, setVoltage, setVoltage, sprocket, sprocket
-
Constructor Details
-
FlyWheel
Construct the FlyWheel class- Parameters:
config- FlyWheel configuration.
-
-
Method Details
-
between
Between two velocities.- Parameters:
start- Start Velocity.end- End velocity- Returns:
Trigger
-
gte
Greater than or equal to angular velocity.- Parameters:
speed-AngularVelocityto check against.- Returns:
Triggerfor FlyWheel.
-
lte
Less than or equal to angular velocity- Parameters:
speed-AngularVelocityto check against- Returns:
Trigger
-
getSpeed
Get theSmartMotorControllerMechanism velocity representing the FlyWheel.- Returns:
- FlyWheel
AngularVelocity
-
isNear
FlyWheel is near a speed.- Parameters:
speed-AngularVelocityto be near.within-AngularVelocitywithin.- Returns:
- Trigger on when the FlyWheel is near another speed.
-
setSpeed
Set the FlyWheel to the given speed.- Parameters:
speed- FlyWheel speed to go to.- Returns:
Commandthat sets the FlyWheel to the desired speed.
-
setSpeed
Set the FlyWheel to the given speed.- Parameters:
speed- FlyWheel speed to go to.- Returns:
Commandthat sets the FlyWheel to the desired speed.
-
max
Description copied from class:SmartVelocityMechanismSmartVelocityMechanismis at max, defined by the soft limit or hard limit on theSmartVelocityMechanism.- Specified by:
maxin classSmartVelocityMechanism- Returns:
- Maximum angle for the
SmartVelocityMechanism.
-
min
Description copied from class:SmartVelocityMechanismMinimum angle of theSmartVelocityMechanismgiven by the soft limit or hard limit of theSmartVelocityMechanism.- Specified by:
minin classSmartVelocityMechanism- Returns:
Triggeron minimum of theSmartVelocityMechanism.
-
sysId
Description copied from class:SmartVelocityMechanismCreate the SysId routine and commands to run the SysId tests. The SysId test will run the mechanism up then down at a constant speed, then run the mechanism up at an increasing speed and down at an increasing speed. Requires the maximum and minimum limit to be set. Runs the mechanism within 1 degree of the maximum and minimum.- Specified by:
sysIdin classSmartVelocityMechanism- Parameters:
maximumVoltage- MaximumVoltageto give to theSmartVelocityMechanism, is the voltage given to run theSmartVelocityMechanismup at a static speed.step- StepVoltageto give to theSmartVelocityMechanism.duration- SysId test duration.- Returns:
SequentialCommandGrouprunning the SysId commands.
-
simIterate
public void simIterate()Description copied from class:SmartMechanismIterate sim- Specified by:
simIteratein classSmartMechanism
-
updateTelemetry
public void updateTelemetry()Description copied from class:SmartMechanismUpdate the mechanism's telemetry.- Specified by:
updateTelemetryin classSmartMechanism
-
visualizationUpdate
public void visualizationUpdate()Updates the angle of the mechanism ligament to match the current angle of the FlyWheel.- Specified by:
visualizationUpdatein classSmartMechanism
-
getRelativeMechanismPosition
Get the relative position of the mechanism, taking into account the relative position defined in theMechanismPositionConfig.- Specified by:
getRelativeMechanismPositionin classSmartMechanism- Returns:
- The relative position of the mechanism as a
Translation3d.
-
getName
Description copied from class:SmartMechanismGet the name of the mechanism.- Specified by:
getNamein classSmartMechanism- Returns:
Stringname.
-
getShooterConfig
Get theFlyWheelConfigobject for thisFlyWheel- Returns:
- The
FlyWheelConfigobject for thisFlyWheel
-