Package yams.mechanisms.positional
Class Pivot
java.lang.Object
yams.mechanisms.SmartMechanism
yams.mechanisms.positional.SmartPositionalMechanism
yams.mechanisms.positional.Pivot
Pivot 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBetween two angles.getAngle()Get theSmartMotorControllerMechanism Position representing the pivot.getName()Get the name of the mechanism.Get thePivotConfigobject for thisPivotGet the relative position of the mechanism, taking into account the relative position defined in theMechanismPositionConfig.Greater than or equal to angle.Pivot is near an angle.Less than or equal to anglemax()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 pivot to the given angle.Set the pivot to the given angle.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 pivot.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
-
Pivot
Construct the Pivot class- Parameters:
config- Pivot configuration.
-
-
Method Details
-
between
Between two angles.- Parameters:
start- Start angle.end- End angle- Returns:
Trigger
-
gte
Greater than or equal to angle.- Parameters:
angle- Angle to check against.- Returns:
Triggerfor Pivot.
-
lte
Less than or equal to angle -
getAngle
Get theSmartMotorControllerMechanism Position representing the pivot.- Returns:
- Pivot
Angle
-
isNear
Pivot is near an angle. -
setAngle
Set the pivot to the given angle.- Parameters:
angle- Pivot angle to go to.- Returns:
Commandthat sets the pivot to the desired angle.
-
setAngle
Set the pivot to the given angle.- Parameters:
angle- Pivot angle to go to.- Returns:
Commandthat sets the pivot to the desired angle.
-
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.
-
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.
-
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 pivot.- 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.
-
getPivotConfig
Get thePivotConfigobject for thisPivot- Returns:
- The
PivotConfigobject for thisPivot
-