Package frc.robot.subsystems.turret
Class Turret
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.turret.Turret
Subsystem representing the robot turret.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRun characterization proceduregoToAngleFieldRelative(Supplier<Rotation2d> rotations) Aim turret in field framegoToAngleRobotRelative(Supplier<Rotation2d> rotations) Aim turret in robot framevoidperiodic()voidbooleansetGoalFieldRelative(Rotation2d targetAngle) Set target angle relative to the field.booleansetGoalRobotRelative(Rotation2d targetAngle, AngularVelocity velocity) setVoltage(DoubleSupplier voltage) Set turret motor's output voltage.voidsetVoltageIO(DoubleSupplier voltage) Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
Turret
Creates a new Turret subsystem.- Parameters:
io- Hardware abstraction used to read sensors and control actuators
-
-
Method Details
-
periodic
public void periodic() -
getTurretHeading
-
setVoltage
Set turret motor's output voltage. -
setVoltageIO
-
setGoalRobotRelative
- Parameters:
targetAngle- gets the goal angle
-
setGoalFieldRelative
Set target angle relative to the field. -
goToAngleRobotRelative
Aim turret in robot frame -
goToAngleFieldRelative
Aim turret in field frame -
characterization
Run characterization procedureWARNING: 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()
-