Package yams.mechanisms.config
Class PivotConfig
java.lang.Object
yams.mechanisms.config.PivotConfig
Pivot config.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPivot Configuration classPivotConfig(PivotConfig cfg) Copy constructor.PivotConfig(SmartMotorController motorController) Pivot Configuration class -
Method Summary
Modifier and TypeMethodDescriptionbooleanApply config changes from this class to theSmartMotorControllerclone()Get the lower hard limit of thePivotGet theMechanismPositionConfigassociated with thisPivotConfig.doublegetMOI()Get the moment of inertia for thePivotsimulation.getMotor()Get theSmartMotorControllerof thePivotDeprecated.Sim color valueGet the starting angle of thePivotNetwork Tables name for thePivotGet the telemetry verbosity of thePivotGet the Upper hard limit of thePivot.withHardLimit(Angle min, Angle max) Set the Hard Limits for simulationwithMechanismPositionConfig(MechanismPositionConfig mechanismPositionConfig) Set the elevator mechanism position configuration.withMOI(double MOI) Configure the MOI directly instead of estimating it with the length and mass of thePivotfor simulation.Configure the MOI directly instead of estimating it with the length and mass of thePivotfor simulation.withSimColor(Color8Bit simColor) Publish the color in sim as this.withSmartMotorController(SmartMotorController motorController) Configure theSmartMotorControllerfor thePivotwithSoftLimits(Angle lowerLimit, Angle upperLimit) Set the pivot soft limits.withStartingPosition(Angle startingPosition) Set the pivot starting position.withTelemetry(String networkRoot, String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Deprecated.withTelemetry(String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Configure telemetry for thePivotmechanism.withWrapping(Angle min, Angle max) Wrap the pivot around these angles.
-
Field Details
-
networkRoot
Deprecated.The network root of the mechanism (Optional).
-
-
Constructor Details
-
PivotConfig
Pivot Configuration class- Parameters:
motorController- PrimarySmartMotorControllerfor thePivot
-
PivotConfig
public PivotConfig()Pivot Configuration class- Implementation Note:
- Required call to
withSmartMotorController(SmartMotorController)before usage.
-
PivotConfig
Copy constructor.- Parameters:
cfg- Config to copy.
-
-
Method Details
-
clone
-
withSmartMotorController
Configure theSmartMotorControllerfor thePivot- Parameters:
motorController-SmartMotorControllerfor thePivot.- Returns:
PivotConfigfor chaining.
-
withSimColor
Publish the color in sim as this.- Parameters:
simColor-Color8Bitto show.- Returns:
PivotConfigfor chaining.
-
withMOI
Configure the MOI directly instead of estimating it with the length and mass of thePivotfor simulation.- Parameters:
MOI- Moment of Inertia of thePivot- Returns:
PivotConfigfor chaining.
-
withMOI
Configure the MOI directly instead of estimating it with the length and mass of thePivotfor simulation.- Parameters:
length- Length of thePivot.weight- Weight of thePivot- Returns:
PivotConfigfor chaining.
-
withTelemetry
public PivotConfig withTelemetry(String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Configure telemetry for thePivotmechanism.- Parameters:
telemetryName- Telemetry NetworkTable name to appear under "SmartDashboard/"telemetryVerbosity- Telemetry verbosity to apply.- Returns:
PivotConfigfor chaining.
-
withTelemetry
@Deprecated public PivotConfig withTelemetry(String networkRoot, String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Deprecated.Configure telemetry for thePivotmechanism.- Parameters:
telemetryName- Telemetry NetworkTable name to appear under "SmartDashboard/"telemetryVerbosity- Telemetry verbosity to apply.networkRoot- Network root to publish the telemetry under.- Returns:
ArmConfigfor chaining.
-
withMechanismPositionConfig
Set the elevator mechanism position configuration.- Parameters:
mechanismPositionConfig-MechanismPositionConfigfor theElevator- Returns:
PivotConfigfor chaining
-
withStartingPosition
Set the pivot starting position.- Parameters:
startingPosition- Starting position of the pivot.- Returns:
PivotConfigfor chaining
-
withSoftLimits
Set the pivot soft limits. When exceeded the power will be set to 0.- Parameters:
lowerLimit- Minimum rotation of the pivot.upperLimit- Maximum rotation of the pivot.- Returns:
PivotConfigfor chaining.
-
withWrapping
Wrap the pivot around these angles. When the pivot exceeds the maximum angle it will read as if it is the minimum angle.- Parameters:
min- Minimum angle for wrappingmax- Maximum angle for wrapping.- Returns:
PivotConfigfor chaining.
-
withHardLimit
Set the Hard Limits for simulation- Parameters:
min- Angle where the physical stop appears.max- Angle where the physical stop appears- Returns:
PivotConfigfor chaining.
-
applyConfig
public boolean applyConfig()Apply config changes from this class to theSmartMotorController- Returns:
SmartMotorController.applyConfig(SmartMotorControllerConfig)result.
-
getMOI
public double getMOI()Get the moment of inertia for thePivotsimulation.- Returns:
- Moment of Inertia.
-
getUpperHardLimit
Get the Upper hard limit of thePivot.- Returns:
Anglehard limit.
-
getLowerHardLimit
Get the lower hard limit of thePivot- Returns:
Anglehard limit.
-
getTelemetryVerbosity
Get the telemetry verbosity of thePivot- Returns:
SmartMotorControllerConfig.TelemetryVerbosityof thePivot
-
getTelemetryName
Network Tables name for thePivot- Returns:
- Network Tables name.
-
getStartingAngle
Get the starting angle of thePivot -
getMotor
Get theSmartMotorControllerof thePivot- Returns:
SmartMotorControllerfor thePivot
-
getSimColor
Sim color value- Returns:
- Sim color value
-
getMechanismPositionConfig
Get theMechanismPositionConfigassociated with thisPivotConfig.- Returns:
- An
Optionalcontaining theMechanismPositionConfigif present, otherwise an emptyOptional.
-
getNetworkRoot
Deprecated.Get the network root of the mechanism.- Returns:
- Optional containing the network root if set, otherwise an empty Optional.
-