YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
YAMS Yet Another Mechanism System

Introduction

YAMS is a C++ FRC robotics library that provides a unified, hardware-agnostic abstraction layer for common robot mechanisms. It wraps REV SPARK and CTRE TalonFX motor controllers behind a single interface and ships ready-to-use implementations for arms, elevators, pivots, flywheels, and swerve drives all with built-in simulation and telemetry support.

Compatible with WPILib 2026, REVLib, and CTRE Phoenix 6.


Key Features


Namespace Overview

Namespace Description
yams Root namespace; include YAMS.hpp to pull in everything
yams::exceptions Exception types thrown by YAMS (e.g. ArmConfigurationException)
yams::gearing GearBox and sprocket/chain gearing calculations
yams::math Control math: LQRController, DerivativeTimeFilter, SmartMath
yams::mechanisms Abstract base SmartMechanism and all concrete implementations
yams::mechanisms::config Config structs for every mechanism type
yams::mechanisms::positional Arm, Elevator, Pivot, SmartPositionalMechanism
yams::mechanisms::velocity FlyWheel, SmartVelocityMechanism
yams::mechanisms::swerve SwerveDrive, SwerveModule, SwerveDriveConfig
yams::mechanisms::swerve::utility SwerveInputStream
yams::motorcontrollers SmartMotorController abstract base and wrapper types
yams::motorcontrollers::local SparkWrapper (REV SPARK MAX / FLEX)
yams::motorcontrollers::remote TalonFXWrapper, TalonFXSWrapper (CTRE Phoenix 6)
yams::motorcontrollers::simulation Simulation suppliers and sensor data
yams::telemetry Mechanism and motor controller telemetry publishers
yams::units Extended FRC unit types (YUnits)

Quick Start

Add the YAMS vendordep JSON to your robot project, then include the convenience header:

Configure and construct a mechanism:

using namespace yams;
// Build a motor controller
rev::spark::SparkMax spark{1, rev::spark::SparkLowLevel::MotorType::kBrushless};
auto motor = std::make_unique<motorcontrollers::local::SparkWrapper>(
spark, frc::DCMotor::NEO(1), motorConfig);
// Build an elevator
auto elevatorConfig = mechanisms::config::ElevatorConfig{}
.withMaxHeightMeters(1.5)
.withMinHeightMeters(0.0);
mechanisms::positional::Elevator elevator{std::move(motor), elevatorConfig};
Definition ElevatorConfig.hpp:26
Definition Elevator.hpp:73
Definition SmartMotorControllerConfig.hpp:65
SmartMotorControllerConfig & WithMotorInverted(bool inverted)
SmartMotorControllerConfig & WithStatorCurrentLimit(wpi::units::ampere_t limit)
Definition exceptions.hpp:9

Further Resources