Class Turret

All Implemented Interfaces:
Sendable, Subsystem

public class Turret extends SubsystemBase
Subsystem representing the robot turret.
  • Constructor Details

    • Turret

      public Turret(TurretIO io, RobotState state)
      Creates a new Turret subsystem.
      Parameters:
      io - Hardware abstraction used to read sensors and control actuators
  • Method Details

    • periodic

      public void periodic()
    • getTurretHeading

      public Rotation2d getTurretHeading()
    • setVoltage

      public Command setVoltage(DoubleSupplier voltage)
      Set turret motor's output voltage.
    • setVoltageIO

      public void setVoltageIO(DoubleSupplier voltage)
    • setGoalRobotRelative

      public boolean setGoalRobotRelative(Rotation2d targetAngle, AngularVelocity velocity)
      Parameters:
      targetAngle - gets the goal angle
    • setGoalFieldRelative

      public boolean setGoalFieldRelative(Rotation2d targetAngle)
      Set target angle relative to the field.
    • goToAngleRobotRelative

      public Command goToAngleRobotRelative(Supplier<Rotation2d> rotations)
      Aim turret in robot frame
    • goToAngleFieldRelative

      public Command goToAngleFieldRelative(Supplier<Rotation2d> rotations)
      Aim turret in field frame
    • characterization

      public Command characterization()
      Run characterization procedure

      WARNING: will not respect min/max turret angles. Unplug everything from the turret so it can spin a potentially infinite number of times.

    • resetTurret

      public void resetTurret()