Package yams.mechanisms.positional
Class Elevator
java.lang.Object
yams.mechanisms.SmartMechanism
yams.mechanisms.positional.SmartPositionalMechanism
yams.mechanisms.positional.Elevator
Elevator mechanism.
-
Field Summary
Fields inherited from class yams.mechanisms.positional.SmartPositionalMechanism
m_mechanismLigament, m_mechanismRootFields inherited from class yams.mechanisms.SmartMechanism
m_mechanismWindow, m_smc, m_subsystem, m_telemetry -
Constructor Summary
ConstructorsConstructorDescriptionElevator(ElevatorConfig config) Construct theElevatorclass for easy manipulation of an elevator. -
Method Summary
Modifier and TypeMethodDescriptionBetween two heights.Get theElevatorConfigfor thisElevatorGet the Height of the Elevator.getName()Get the name of the mechanism.Get the relative position of the mechanism, taking into account the relative position defined in theMechanismPositionConfig.Get the linear velocity of the Elevator.Greater than or equal to height.Elevator is near a height.Less than or equal to heightmax()SmartPositionalMechanismis at max, defined by the soft limit or hard limit on theSmartPositionalMechanism.min()Minimum angle of theSmartPositionalMechanismgiven by the soft limit or hard limit of theSmartPositionalMechanism.Set the height of the elevator.Set the height of the elevator.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 length of the mechanism ligament to match the current height of the elevator in meters.Methods inherited from class yams.mechanisms.positional.SmartPositionalMechanism
getMechanismLigament, getMechanismRoot, getMotorMethods inherited from class yams.mechanisms.SmartMechanism
gearbox, gearbox, gearing, gearing, getMechanismSetpoint, getMechanismWindow, getMotorController, set, set, setVoltage, setVoltage, sprocket, sprocket
-
Constructor Details
-
Elevator
Construct theElevatorclass for easy manipulation of an elevator.- Parameters:
config-ElevatorConfigto set.
-
-
Method Details
-
updateTelemetry
public void updateTelemetry()Description copied from class:SmartMechanismUpdate the mechanism's telemetry.- Specified by:
updateTelemetryin classSmartMechanism
-
simIterate
public void simIterate()Description copied from class:SmartMechanismIterate sim- Specified by:
simIteratein classSmartMechanism
-
visualizationUpdate
public void visualizationUpdate()Updates the length of the mechanism ligament to match the current height of the elevator in meters.- 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.
-
setHeight
Set the height of the elevator.- Parameters:
height- Height of the elevator to reach.- Returns:
Commandthat sets the elevator height, stops immediately.
-
setHeight
Set the height of the elevator.- Parameters:
height- Height of the elevator to reach.- Returns:
Commandthat sets the elevator height, stops immediately.
-
getHeight
Get the Height of the Elevator.- Returns:
Distanceof the Elevator.
-
getVelocity
Get the linear velocity of the Elevator.- Returns:
LinearVelocityof the elevator.
-
isNear
Elevator is near a height. -
max
Description copied from class:SmartPositionalMechanismSmartPositionalMechanismis at max, defined by the soft limit or hard limit on theSmartPositionalMechanism.- Specified by:
maxin classSmartPositionalMechanism- Returns:
- Maximum angle for the
SmartPositionalMechanism.
-
min
Description copied from class:SmartPositionalMechanismMinimum angle of theSmartPositionalMechanismgiven by the soft limit or hard limit of theSmartPositionalMechanism.- Specified by:
minin classSmartPositionalMechanism- Returns:
Triggeron minimum of theSmartPositionalMechanism.
-
between
Between two heights.- Parameters:
start- Start height.end- End height.- Returns:
Trigger
-
lte
Less than or equal to height -
gte
Greater than or equal to height.- Parameters:
height- Height to check against.- Returns:
Triggerfor elevator.
-
sysId
Description copied from class:SmartPositionalMechanismCreate 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 classSmartPositionalMechanism- Parameters:
maximumVoltage- MaximumVoltageto give to theSmartPositionalMechanism, is the voltage given to run theSmartPositionalMechanismup at a static speed.step- StepVoltageto give to theSmartPositionalMechanism.duration- SysId test duration.- Returns:
SequentialCommandGrouprunning the SysId commands.
-
getConfig
Get theElevatorConfigfor thisElevator- Returns:
ElevatorConfigfor thisElevator
-