Package frc.robot.autonomous.actions
Class TurnToCommand
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.CommandBase
-
- frc.robot.autonomous.actions.TurnToCommand
-
- All Implemented Interfaces:
edu.wpi.first.wpilibj.Sendable,edu.wpi.first.wpilibj2.command.Command
public class TurnToCommand extends edu.wpi.first.wpilibj2.command.CommandBaseCommand for handling autonomous turning with PID solve
-
-
Constructor Summary
Constructors Constructor Description TurnToCommand(double angleDegs)Turn to a field-relative angleTurnToCommand(double angleDegs, double epsilon)Turn to a field-relative angleTurnToCommand(edu.wpi.first.wpilibj.geometry.Rotation2d setpoint)Turn to a field-relative angleTurnToCommand(edu.wpi.first.wpilibj.geometry.Rotation2d setpoint, double epsilon)Turn to a field-relative angle
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidend(boolean interrupted)voidexecute()voidinitialize()booleanisFinished()-
Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase
addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
TurnToCommand
public TurnToCommand(double angleDegs)
Turn to a field-relative angle- Parameters:
angleDegs- Desired angle in degrees (field-relative)
-
TurnToCommand
public TurnToCommand(double angleDegs, double epsilon)Turn to a field-relative angle- Parameters:
angleDegs- Desired angle in degrees (field-relative)epsilon- Allowed error (in degrees)
-
TurnToCommand
public TurnToCommand(edu.wpi.first.wpilibj.geometry.Rotation2d setpoint)
Turn to a field-relative angle- Parameters:
setpoint- Desired angle as rotation vector (field-relative)
-
TurnToCommand
public TurnToCommand(edu.wpi.first.wpilibj.geometry.Rotation2d setpoint, double epsilon)Turn to a field-relative angle- Parameters:
setpoint- Desired angle as rotation vector (field-relative)epsilon- Allowed error (in degrees)
-
-