Yet Another Mechanism System API
Yet Another Mechanism System (YAMS)
YAMS is a unified FRC mechanism library that provides a hardware-agnostic API for controlling robot mechanisms powered by REV SPARK MAX/FLEX or CTRE TalonFX/TalonFXS motor controllers. It is compatible with WPILib 2026 and targets FRC teams that want consistent, simulation-ready mechanism abstractions without vendor lock-in.
Key Features
- Unified SmartMotorController abstraction one API for REV SPARK and CTRE TalonFX hardware.
- Ready-to-use mechanisms Arm, Elevator, Pivot, FlyWheel, SwerveDrive, and more, each with builder-style configuration.
- Physics-based simulation drop-in sim suppliers (ArmSimSupplier, DCMotorSimSupplier) for hardware-free testing.
- NetworkTables telemetry MechanismTelemetry and SmartMotorControllerTelemetry publish live data to Shuffleboard/AdvantageScope.
- Builder-style config every mechanism and motor controller is configured through fluent builder objects, keeping construction readable and safe.
Quick Start
// 1. Configure the motor controller
SmartMotorControllerConfig motorConfig = new SmartMotorControllerConfig()
.withClosedLoopController(4, 0, 0)
.withSoftLimits(Degrees.of(-30), Degrees.of(100))
.withGearing(new MechanismGearing(GearBox.fromReductionStages(3, 4)))
.withIdleMode(MotorMode.BRAKE)
.withTelemetry("ArmMotor", TelemetryVerbosity.HIGH)
.withStatorCurrentLimit(Amps.of(40))
.withMotorInverted(false)
.withFeedforward(new ArmFeedforward(0, 0, 0, 0))
.withControlMode(ControlMode.CLOSED_LOOP)
.withStartingPosition(Degrees.of(0));
// 2. Instantiate the appropriate vendor wrapper
SmartMotorController motor = new SparkWrapper(new SparkMax(1, MotorType.kBrushless), DCMotor.getNEO(1), motorConfig);
// 3. Build an ArmConfig describing the physical arm
ArmConfig armConfig = new ArmConfig()
.withMotor(motor)
.withArmLength(Meters.of(0.5))
.withMinAngle(Degrees.of(-90))
.withMaxAngle(Degrees.of(90));
// 4. Construct the Arm mechanism
Arm arm = new Arm(armConfig);
// 5. Schedule a setpoint command
arm.setAngle(Degrees.of(45)).schedule();
Package Summary
| Package | Description |
|---|---|
| yams | Root package; entry point and top-level library classes. |
| yams.core.exceptions | Configuration and runtime exception types thrown by YAMS. |
| yams.core.gearing | GearBox, Sprocket, and MechanismGearing for gear-ratio math. |
| yams.core.math | LQR solver, derivative filter, and general math utilities. |
| yams.core.mechanisms | SmartMechanism abstract base class shared by all mechanism types. |
| yams.core.mechanisms.config | Builder and config classes for configuring every supported mechanism. |
| yams.core.mechanisms.positional | Arm, Elevator, Pivot, DifferentialMechanism, and DoubleJointedArm implementations. |
| yams.core.mechanisms.velocity | FlyWheel and SmartVelocityMechanism for velocity-controlled subsystems. |
| yams.core.mechanisms.swerve | SwerveDrive and SwerveModule for full swerve drivetrain control. |
| yams.commands2.swerve | Commands v2 SwerveDrive and SwerveInputStream (driver input from suppliers). |
| yams.commands3.swerve | Commands v3 SwerveDrive and SwerveInputStream (driver input set from drive coroutines). |
| yams.core.motorcontrollers | SmartMotorController abstract base, SmartMotorControllerConfig, and vendor wrappers (SparkWrapper, TalonFXWrapper, TalonFXSWrapper). |
| yams.core.motorcontrollers.local | SparkWrapper REV SPARK MAX and SPARK FLEX integration. |
| yams.core.motorcontrollers.remote | TalonFXWrapper and TalonFXSWrapper CTRE Phoenix 6 integration. |
| yams.core.motorcontrollers.simulation | ArmSimSupplier, DCMotorSimSupplier, and Sensor for physics-based simulation. |
| yams.core.telemetry | MechanismTelemetry and SmartMotorControllerTelemetry for NetworkTables publishing. |
| yams.core.units | YUnits and EasyCRT unit helpers for WPILib unit conversions. |
Packages
Package
Description
Builder-style configuration classes for every mechanism in the YAMS library.
Swerve drive mechanism classes.
Commands v3 configuration classes for the YAMS library.
Commands v3 swerve drive.
Exceptions for YAMS.
Yet Another Mechanism System gearing classes for easier calculations.
Yet Another Mechanism System math classes for easier calculations.
Top-level mechanism abstractions for the YAMS (Yet Another Mechanism System) library.
Builder-style configuration classes for every mechanism in the YAMS library.
Enums used to configure mechanisms: the gyro axis a
SwerveDriveConfig reads its heading from.Position-controlled mechanism implementations for the YAMS library.
Swerve drive mechanism classes.
Velocity-controlled mechanism implementations for the YAMS library.
Hardware-agnostic motor controller abstractions for FRC mechanisms.
Enums used to configure a
SmartMotorController: control
mode and zero power mode.REV Robotics motor controller wrappers whose closed-loop control runs on the roboRIO.
CTRE motor controller wrappers whose closed-loop control runs on the motor controller itself.
Physics-based simulation suppliers for YAMS motor controllers.
NetworkTables publishers for mechanism and motor controller state.
Enums used to configure YAMS telemetry.
Extended unit-of-measure types and conversion helpers.