Package yams.mechanisms.config
Class ElevatorConfig
java.lang.Object
yams.mechanisms.config.ElevatorConfig
Elevator configuration class.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionElevator Configuration classElevatorConfig(SmartMotorController motorController) Elevator Configuration class -
Method Summary
Modifier and TypeMethodDescriptionbooleanApply config changes from this class to theSmartMotorControllerclone()getAngle()Get the Angle of theElevatorGet theElevatordrum radius.Get the Upper hard limit of theElevator.Get the mechanism position configuration of the elevator.Get the lower hard limit of theElevatorgetMotor()Get theSmartMotorControllerof theElevatorDeprecated.Get sim colorGet the starting height of theElevatorNetwork Tables name for theElevatorGet the telemetry verbosity of theElevatorConfigure theElevators angle for simulation.withCascadingElevatorStages(int stages) Change theSmartMotorControllerConfiggear ratio to be divided by the number of stages given, will reapply it if already done manually.withDrumRadius(Distance drumRadius) Set theElevatordrum radius.withDrumRadius(Distance chainPitch, int teeth) Set theElevatordrum radius via the chain pitch (.25in or .35in) and teeth count.withHardLimits(Distance min, Distance max) Set the Hard Limits for simulationwithMechanismPositionConfig(MechanismPositionConfig mechanismPositionConfig) Set the elevator mechanism position configuration.withSimColor(Color8Bit simColor) Publish the color in sim as this.withSmartMotorController(SmartMotorController motorController) Set theSmartMotorControllerfor theElevatorwithSoftLimits(Distance lowerLimit, Distance upperLimit) Set the elevator soft limits.withStartingHeight(Distance startingPosition) Set the elevator starting position.withTelemetry(String networkRoot, String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Deprecated.withTelemetry(String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Configure telemetry for theElevatormechanism.
-
Field Details
-
networkRoot
Deprecated.The network root of the mechanism (Optional).
-
-
Constructor Details
-
ElevatorConfig
Elevator Configuration class- Parameters:
motorController- PrimarySmartMotorControllerfor theElevator
-
ElevatorConfig
public ElevatorConfig()Elevator Configuration class- Implementation Note:
- You are REQUIRED to call
withSmartMotorController(SmartMotorController)before this is used with anElevator
-
-
Method Details
-
clone
-
withSmartMotorController
Set theSmartMotorControllerfor theElevator- Parameters:
motorController- PrimarySmartMotorControllerfor theElevator- Returns:
ElevatorConfigfor chaining.
-
withDrumRadius
Set theElevatordrum radius.- Parameters:
drumRadius- Elevator drum radius- Returns:
ElevatorConfigfor chaining.
-
withDrumRadius
Set theElevatordrum radius via the chain pitch (.25in or .35in) and teeth count.- Parameters:
chainPitch- Chain pitch.teeth- Sprocket teeth count.- Returns:
ElevatorConfigfor chaining.
-
withSimColor
Publish the color in sim as this.- Parameters:
simColor-Color8Bitto show.- Returns:
ElevatorConfigfor chaining.
-
withAngle
Configure theElevators angle for simulation.- Parameters:
angle- Angle of theElevator.- Returns:
ElevatorConfigfor chaining.
-
withMass
- Parameters:
mass-Massof theElevator- Returns:
ElevatorConfigfor chaining.
-
withTelemetry
public ElevatorConfig withTelemetry(String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Configure telemetry for theElevatormechanism.- Parameters:
telemetryName- Telemetry NetworkTable name to appear under "SmartDashboard/"telemetryVerbosity- Telemetry verbosity to apply.- Returns:
ElevatorConfigfor chaining.
-
withTelemetry
@Deprecated public ElevatorConfig withTelemetry(String networkRoot, String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Deprecated.Configure telemetry for theArmmechanism.- Parameters:
telemetryName- Telemetry NetworkTable name to appear under "SmartDashboard/"telemetryVerbosity- Telemetry verbosity to apply.networkRoot- Network root to publish the telemetry under.- Returns:
ElevatorConfigfor chaining.
-
withCascadingElevatorStages
Change theSmartMotorControllerConfiggear ratio to be divided by the number of stages given, will reapply it if already done manually.- Parameters:
stages- Stages given- Returns:
ElevatorConfigfor chaining.
-
withMechanismPositionConfig
Set the elevator mechanism position configuration.- Parameters:
mechanismPositionConfig-MechanismPositionConfigfor theElevator- Returns:
ElevatorConfigfor chaining
-
withStartingHeight
Set the elevator starting position.- Parameters:
startingPosition- Starting position of the elevator.- Returns:
ElevatorConfigfor chaining
-
withSoftLimits
Set the elevator soft limits. When exceeded the power will be set to 0.- Parameters:
lowerLimit- Minimum distance of the elevator.upperLimit- Maximum distance of the elevator.- Returns:
ElevatorConfigfor chaining.
-
withHardLimits
Set the Hard Limits for simulation- Parameters:
min- Height where the physical stop appears.max- Height where the physical stop appears- Returns:
ElevatorConfigfor chaining.
-
applyConfig
public boolean applyConfig()Apply config changes from this class to theSmartMotorController- Returns:
SmartMotorController.applyConfig(SmartMotorControllerConfig)result.
-
getAngle
Get the Angle of theElevator- Returns:
Angleof the Elevator.
-
getMaximumHeight
Get the Upper hard limit of theElevator.- Returns:
Distancehard limit.
-
getMinimumHeight
Get the lower hard limit of theElevator- Returns:
Distancehard limit.
-
getTelemetryVerbosity
Get the telemetry verbosity of theElevator- Returns:
SmartMotorControllerConfig.TelemetryVerbosityof theElevator
-
getTelemetryName
Network Tables name for theElevator- Returns:
- Network Tables name.
-
getStartingHeight
Get the starting height of theElevator -
getMotor
Get theSmartMotorControllerof theElevator- Returns:
SmartMotorControllerfor theElevator
-
getSimColor
Get sim color- Returns:
- sim color
-
getDrumRadius
Get theElevatordrum radius.- Returns:
- Drum radius of the elevator.
-
getCarriageMass
- Returns:
- Carriage mass.
-
getMechanismPositionConfig
Get the mechanism position configuration of the elevator.- Returns:
- Optional containing the mechanism position configuration if set, otherwise an empty Optional.
-
getNetworkRoot
Deprecated.Get the network root of the mechanism.- Returns:
- Optional containing the network root if set, otherwise an empty Optional.
-