Package yams.core.motorcontrollers
package yams.core.motorcontrollers
Hardware-agnostic motor controller abstractions for FRC mechanisms.
This package provides a unified API for controlling brushless motor controllers from multiple
vendors. All concrete wrappers extend SmartMotorController,
which exposes position, velocity, and voltage control modes without reference to any
vendor-specific types.
Core types
SmartMotorControllerthe hardware-agnostic abstract base that all vendor wrappers extend. Defines the lifecycle methods (configure,periodic,stop) and the control interface (position, velocity, voltage, duty-cycle setpoints).SmartMotorControllerConfiga fluent builder used to configure every aspect of a motor before it is applied. Settings include PID gains, feedforward constants, position and velocity software limits, ramp rates, current limits, encoder resolution and offsets, and gear ratios. CallSmartMotorController.configure(config)to push all settings to hardware.-
SmartMotorControllerCommandRegistryregisters WPILibCommandobjects that operate a specific motor so they can be discovered and scheduled by a mechanism.
Usage example
SmartMotorControllerConfig config = new SmartMotorControllerConfig()
.withPID(0.1, 0.0, 0.001)
.withCurrentLimit(40)
.withPositionConversionFactor(2 * Math.PI / 42.0);
SmartMotorController motor = new SparkWrapper(
new SparkMax(1, MotorType.kBrushless), DCMotor.getNEO(1), config);
motor.setPositionSetpoint(Math.PI / 2);
Sub-packages
yams.core.motorcontrollers.localREV Robotics SPARK MAX and SPARK FLEX wrappers that run closed-loop control on the roboRIO.yams.core.motorcontrollers.remoteCTRE TalonFX and TalonFXS wrappers that run closed-loop control on the motor controller itself via the Phoenix 6 API.yams.core.motorcontrollers.simulationsimulation-only implementations used in unit tests and the WPILib simulation GUI.
-
ClassDescriptionProvides sim functions for a YAMS simulated mechanism.Smart motor controller wrapper for motor controllers.Current closed loop controller slot.SmartMotorControllerConfig<T extends SmartMotorControllerConfig<T>>Smart motor controller config.All possible options that must be checked and applied during motor config application.
DCMotormodels of motors WPILib does not have a model of.