Package yams.core.mechanisms.config
package yams.core.mechanisms.config
Builder-style configuration classes for every mechanism in the YAMS library.
Every YAMS mechanism requires a corresponding config object to be constructed before the
mechanism itself is instantiated. Config classes follow a fluent builder pattern: each
with*() setter mutates the config and returns this, allowing calls to be chained
in a single expression.
Available Configuration Classes
ArmConfigsingle-jointed arm with angle limits and feedforward tuningElevatorConfiglinear elevator with height limits and gravity compensationPivotConfigpivot mechanism with continuous or bounded rotationFlyWheelConfigflywheel velocity mechanism with optional second follower motorSwerveDriveConfigfull swerve-drive chassis geometry and module layout-
SwerveModuleConfigper-module drive and steer motor configuration DifferentialMechanismConfigdifferential (tank-drive) mechanism pairing two motorsMechanismPositionConfigposition targets and tolerance settings shared across positional mechanismsSensorConfigexternal encoder or absolute sensor attachment configuration
Motor Controller Requirement
A SmartMotorController must be provided before most
mechanisms can be constructed. It may be supplied either through the config constructor or via
the withSmartMotorController() setter:
SmartMotorController motor = new TalonFXController(new TalonFX(1));
// Option A: pass in the constructor
ElevatorConfig config = new ElevatorConfig(motor)
.withMaxHeight(Meters.of(1.5))
.withGearing(9.0);
// Option B: set via fluent API
ElevatorConfig config = new ElevatorConfig()
.withSmartMotorController(motor)
.withMaxHeight(Meters.of(1.5))
.withGearing(9.0);
Fluent Chaining Example
ArmConfig armConfig = new ArmConfig(motor)
.withGearing(100.0)
.withSoftLimits(Rotation2d.fromDegrees(-90), Rotation2d.fromDegrees(90))
.withFeedforward(new ArmFeedforward(0.1, 0.5, 1.2))
.withSensor(new SensorConfig(encoder).withOffset(Rotation2d.fromDegrees(15)));
- See Also:
-
ClassDescriptionArm configuration class.Configuration for a
DifferentialMechanismdriven by two coordinated motors working differentially.Elevator configuration class.FlyWheel configuration class.A configuration class for specifying the position and visualization properties of a mechanism relative to a robot in a 3D coordinate system.The planes that the mechanism could be on, used for position calculations.Pivot configuration class.Sensor configuration for simulated and real sensors.SwerveDriveConfig<T extends SwerveDriveConfig<T>>Swerve Drive Configuration.Swerve Module