Class FlyWheelConfig
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe network root of the mechanism (Optional). -
Constructor Summary
ConstructorsConstructorDescriptionFlyWheel configuration class.FlyWheelConfig(SmartMotorController motorController) Arm Configuration class -
Method Summary
Modifier and TypeMethodDescriptionbooleanApply config changes from this class to theSmartMotorControllerclone()Disable the use of the speedometer simulation for the shooter.Get the Length of theFlyWheelGet the lower soft limit of the shooter.Get theMechanismPositionConfigassociated with thisFlyWheelConfig.doublegetMOI()Get the moment of inertia for theFlyWheelsimulation.getMotor()Get theSmartMotorControllerof theFlyWheelGet sim colorGet the maximum velocity of the speedometer simulation.Network Tables name for theFlyWheelDeprecated.Get the telemetry verbosity of theFlyWheelGet the upper soft limit for the shooter.booleanCheck if the shooter is using the speedometer simulation.withDiameter(Distance distance) Configure theFlyWheels diameter for simulation.Set the minimum velocity of the shooter.withMechanismPositionConfig(MechanismPositionConfig mechanismPositionConfig) Set the shooter mechanism position configuration.withMOI(double MOI) Configure the MOI directly instead of estimating it with the length and mass of theFlyWheelfor simulation.Configure the MOI directly instead of estimating it with the length and mass of theFlyWheelfor simulation.withSimColor(Color8Bit simColor) Publish the color in sim as this.withSmartMotorController(SmartMotorController motorController) Set theSmartMotorControllerfor theFlyWheelwithSoftLimit(AngularVelocity low, AngularVelocity high) Set the shooter soft limits.Enables the use of the speedometer simulation for the shooter.withSpeedometerSimulation(AngularVelocity maxVelocity) Enables the use of the speedometer simulation for the shooter.withTelemetry(String networkRoot, String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Deprecated.withTelemetry(String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Configure telemetry for theFlyWheelmechanism.Set the maximum velocity of the shooter.
-
Field Details
-
networkTableName
The network root of the mechanism (Optional).
-
-
Constructor Details
-
FlyWheelConfig
Arm Configuration class- Parameters:
motorController- PrimarySmartMotorControllerfor theFlyWheel
-
FlyWheelConfig
public FlyWheelConfig()FlyWheel configuration class.- Implementation Note:
- Required to call
withSmartMotorController(SmartMotorController)before this is used with anFlyWheel
-
-
Method Details
-
clone
-
withSmartMotorController
Set theSmartMotorControllerfor theFlyWheel- Parameters:
motorController- PrimarySmartMotorControllerfor theFlyWheel- Returns:
FlyWheelConfigfor chaining.
-
withLowerSoftLimit
Set the minimum velocity of the shooter. Also updates the speedometer simulation max velocity- Parameters:
speed- Minimum velocity of the shooter.- Returns:
FlyWheelConfigfor chaining
-
withUpperSoftLimit
Set the maximum velocity of the shooter. Also updates the speedometer simulation max velocity- Parameters:
speed- Maximum velocity of the shooter.- Returns:
FlyWheelConfigfor chaining.
-
withSoftLimit
Set the shooter soft limits.- Parameters:
low- Minimum velocity of the shooter.high- Maximum velocity of the shooter.- Returns:
FlyWheelConfigfor chaining.
-
withSpeedometerSimulation
Enables the use of the speedometer simulation for the shooter.The speedometer simulation is a simulation of a speedometer that is used to simulate the behavior of the shooter. This is useful for testing and debugging the shooter without having to physically move it.
- Parameters:
maxVelocity- The maximum velocity of the shooter.- Returns:
FlyWheelConfigfor chaining.
-
withSpeedometerSimulation
Enables the use of the speedometer simulation for the shooter.The speedometer simulation is a simulation of a speedometer that is used to simulate the behavior of the shooter. This is useful for testing and debugging the shooter without having to physically move it.
- Returns:
FlyWheelConfigfor chaining.
-
disableSpeedometerSimulation
Disable the use of the speedometer simulation for the shooter.The speedometer simulation is a simulation of a speedometer that is used to simulate the behavior of the shooter. This is useful for testing and debugging the shooter without having to physically move it.
- Returns:
FlyWheelConfigfor chaining.
-
isUsingSpeedometerSimulation
public boolean isUsingSpeedometerSimulation()Check if the shooter is using the speedometer simulation.The speedometer simulation is a simulation of the speedometer that is used to simulate the behavior of the shooter. This is useful for testing and debugging the shooter without having to physically move it.
- Returns:
- True if the shooter is using the speedometer simulation.
-
getSpeedometerMaxVelocity
Get the maximum velocity of the speedometer simulation.If the speedometer simulation is not enabled, this will return an empty Optional.
- Returns:
- The maximum velocity of the speedometer simulation, or an empty Optional if the speedometer simulation is not enabled.
-
withSimColor
Publish the color in sim as this.- Parameters:
simColor-Color8Bitto show.- Returns:
FlyWheelConfigfor chaining.
-
withMOI
Configure the MOI directly instead of estimating it with the length and mass of theFlyWheelfor simulation.- Parameters:
MOI- Moment of Inertia of theFlyWheel- Returns:
FlyWheelConfigfor chaining.
-
withMOI
Configure the MOI directly instead of estimating it with the length and mass of theFlyWheelfor simulation.- Parameters:
length- Length of theFlyWheel.weight- Weight of theFlyWheel- Returns:
FlyWheelConfigfor chaining.
-
withDiameter
Configure theFlyWheels diameter for simulation.- Parameters:
distance- Length of theFlyWheel.- Returns:
FlyWheelConfigfor chaining.
-
withMass
- Parameters:
mass-Massof theFlyWheel- Returns:
FlyWheelConfigfor chaining.
-
withMechanismPositionConfig
Set the shooter mechanism position configuration.- Parameters:
mechanismPositionConfig-MechanismPositionConfigfor theFlyWheel- Returns:
FlyWheelConfigfor chaining
-
withTelemetry
public FlyWheelConfig withTelemetry(String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Configure telemetry for theFlyWheelmechanism.- Parameters:
telemetryName- Telemetry NetworkTable name to appear under "SmartDashboard/"telemetryVerbosity- Telemetry verbosity to apply.- Returns:
FlyWheelConfigfor chaining.
-
withTelemetry
@Deprecated public FlyWheelConfig withTelemetry(String networkRoot, String telemetryName, SmartMotorControllerConfig.TelemetryVerbosity telemetryVerbosity) Deprecated.Configure telemetry for theFlyWheelmechanism.- Parameters:
networkRoot- Telemetry NetworkTabletelemetryName- Telemetry NetworkTable name to appear under _networkTableName_telemetryVerbosity- Telemetry verbosity to apply.- Returns:
FlyWheelConfigfor chaining.
-
applyConfig
public boolean applyConfig()Apply config changes from this class to theSmartMotorController- Returns:
SmartMotorController.applyConfig(SmartMotorControllerConfig)result.
-
getLength
Get the Length of theFlyWheel- Returns:
Distanceof the Arm.
-
getMOI
public double getMOI()Get the moment of inertia for theFlyWheelsimulation.- Returns:
- Moment of Inertia.
-
getTelemetryVerbosity
Get the telemetry verbosity of theFlyWheel- Returns:
SmartMotorControllerConfig.TelemetryVerbosityof theFlyWheel
-
getUpperSoftLimit
Get the upper soft limit for the shooter.- Returns:
- Maximum velocity of the shooter.
-
getLowerSoftLimit
Get the lower soft limit of the shooter.- Returns:
- Minimum velocity of the shooter.
-
getTelemetryName
Network Tables name for theFlyWheel- Returns:
- Network Tables name.
-
getMotor
Get theSmartMotorControllerof theFlyWheel- Returns:
SmartMotorControllerfor theFlyWheel
-
getSimColor
Get sim color- Returns:
- sim color.
-
getMechanismPositionConfig
Get theMechanismPositionConfigassociated with thisFlyWheelConfig.- Returns:
- An
Optionalcontaining theMechanismPositionConfigif present, otherwise an emptyOptional.
-
getTelemetryNetworkTableName
Deprecated.Get the telemetry network subtable of the mechanism.- Returns:
- Optional containing the telemetry network subtable if set, otherwise an empty Optional.
-