Class TurretSim

java.lang.Object
frc.robot.subsystems.turret.TurretSim
All Implemented Interfaces:
TurretIO

public class TurretSim extends Object implements TurretIO
Simulation implementation of TurretIO.

This class provides a lightweight software model of the turret hardware for use in simulation, unit testing, and log replay. It maintains an internal turret angle state and generates synthetic absolute encoder readings based on the configured gear ratios and offsets.

To better approximate real sensor behavior, small amounts of random noise are added to each simulated encoder measurement. This helps exercise the turret angle estimation and filtering logic under non-ideal conditions.

This simulation does not model turret dynamics such as inertia, acceleration limits, or closed-loop control behavior. Target angles are applied instantaneously.