Class PivotConfig
java.lang.Object
yams.core.mechanisms.config.PivotConfig
Pivot configuration class.
Configuration Example
// Create the motor controller configuration with PID and feedforward gains
SmartMotorControllerConfig motorConfig = new SmartMotorControllerConfig()
.withClosedLoopController(0.15,0,0)
.withFeedforward(new SimpleMotorFeedforward(0.004, 0.05, 0.2)
.withStatorCurrentLimit(Amps.of(40))
.withMechanismUpperLimit(Degrees.of(60))
.withMechanismLowerLimit(Degrees.of(0))
.withStartingPosition(Degrees.of(0));
SmartMotorController motor = new TalonFXWrapper(
new TalonFX(3),
DCMotor.getKrakenX60(1),
motorConfig);
// Build the pivot config and mechanism
PivotConfig config = new PivotConfig()
.withHardLimits(Degrees.of(0), Degrees.of(60))
.withTelemetry("ShooterHood", TelemetryVerbosity.HIGH);
Pivot pivot = new Pivot(config, motor);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Optional<org.wpilib.units.measure.Angle> Get the lower hard limit of thePivotGet theMechanismPositionConfigassociated with thisPivotConfig.org.wpilib.util.Color8BitSim color valueNetwork Tables name for thePivotGet the telemetry verbosity of thePivotOptional<org.wpilib.units.measure.Angle> Get the Upper hard limit of thePivot.withHardLimits(org.wpilib.units.measure.Angle min, org.wpilib.units.measure.Angle max) Set the Hard Limits for simulationwithMechanismPositionConfig(MechanismPositionConfig mechanismPositionConfig) Set the elevator mechanism position configuration.withSimColor(org.wpilib.util.Color8Bit simColor) Publish the color in sim as this.withTelemetry(String telemetryName, TelemetryVerbosity telemetryVerbosity) Configure telemetry for thePivotmechanism.
-
Constructor Details
-
PivotConfig
public PivotConfig()Pivot Configuration class- Implementation Note:
- Defaults to XY plane.
-
PivotConfig
-
-
Method Details
-
clone
-
withSimColor
Publish the color in sim as this.- Parameters:
simColor-Color8Bitto show.- Returns:
PivotConfigfor chaining.
-
withTelemetry
Configure telemetry for thePivotmechanism.- Parameters:
telemetryName- Telemetry NetworkTable name to appear under "SmartDashboard/"telemetryVerbosity- Telemetry verbosity to apply.- Returns:
PivotConfigfor chaining.
-
withMechanismPositionConfig
Set the elevator mechanism position configuration.- Parameters:
mechanismPositionConfig-MechanismPositionConfigfor theElevator- Returns:
PivotConfigfor chaining
-
withHardLimits
public PivotConfig withHardLimits(org.wpilib.units.measure.Angle min, org.wpilib.units.measure.Angle max) Set the Hard Limits for simulation- Parameters:
min- Angle where the physical stop appears.max- Angle where the physical stop appears- Returns:
PivotConfigfor chaining.
-
getUpperHardLimit
-
getLowerHardLimit
-
getTelemetryVerbosity
Get the telemetry verbosity of thePivot- Returns:
TelemetryVerbosityof thePivot
-
getTelemetryName
-
getSimColor
public org.wpilib.util.Color8Bit getSimColor()Sim color value- Returns:
- Sim color value
-
getMechanismPositionConfig
Get theMechanismPositionConfigassociated with thisPivotConfig.- Returns:
- An
Optionalcontaining theMechanismPositionConfigif present, otherwise an emptyOptional.
-