Class TimedCommand

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

    public class TimedCommand
    extends edu.wpi.first.wpilibj2.command.CommandBase
    Command to run a command for a set time.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected edu.wpi.first.wpilibj2.command.Command command  
      protected double timeout  
      protected edu.wpi.first.wpilibj.Timer timer  
      • Fields inherited from class edu.wpi.first.wpilibj2.command.CommandBase

        m_requirements
    • Constructor Summary

      Constructors 
      Constructor Description
      TimedCommand​(edu.wpi.first.wpilibj2.command.Command command, double timeout)  
    • 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, withName
      • 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, beforeStarting, cancel, deadlineWith, hasRequirement, isScheduled, perpetually, raceWith, runsWhenDisabled, schedule, schedule, until, withInterrupt, withTimeout
    • Field Detail

      • command

        protected edu.wpi.first.wpilibj2.command.Command command
      • timer

        protected edu.wpi.first.wpilibj.Timer timer
      • timeout

        protected double timeout
    • Constructor Detail

      • TimedCommand

        public TimedCommand​(edu.wpi.first.wpilibj2.command.Command command,
                            double timeout)
    • Method Detail

      • initialize

        public void initialize()
      • execute

        public void execute()
      • end

        public void end​(boolean interrupted)
      • isFinished

        public boolean isFinished()