Class TurnToCommand

  • All Implemented Interfaces:
    edu.wpi.first.wpilibj.Sendable, edu.wpi.first.wpilibj2.command.Command

    public class TurnToCommand
    extends edu.wpi.first.wpilibj2.command.CommandBase
    Command for handling autonomous turning with PID solve
    • Field Summary

      • Fields inherited from class edu.wpi.first.wpilibj2.command.CommandBase

        m_requirements
    • Constructor Summary

      Constructors 
      Constructor Description
      TurnToCommand​(double angleDegs)
      Turn to a field-relative angle
      TurnToCommand​(double angleDegs, double epsilon)
      Turn to a field-relative angle
      TurnToCommand​(edu.wpi.first.wpilibj.geometry.Rotation2d setpoint)
      Turn to a field-relative angle
      TurnToCommand​(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
      void end​(boolean interrupted)  
      void execute()  
      void initialize()  
      boolean isFinished()  
      • 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
      • Methods inherited from interface edu.wpi.first.wpilibj2.command.Command

        alongWith, andThen, andThen, asProxy, beforeStarting, cancel, deadlineWith, hasRequirement, isScheduled, perpetually, raceWith, runsWhenDisabled, schedule, schedule, withInterrupt, withTimeout
      • Methods inherited from interface edu.wpi.first.wpilibj.Sendable

        addChild, setName, setName, setName
    • 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)
    • Method Detail

      • initialize

        public void initialize()
      • execute

        public void execute()
      • end

        public void end​(boolean interrupted)
      • isFinished

        public boolean isFinished()