Class CmdDriveMotorsTest

java.lang.Object
trclib.command.CmdDriveMotorsTest
All Implemented Interfaces:
TrcRobot.RobotCommand

public class CmdDriveMotorsTest extends Object implements TrcRobot.RobotCommand
This class implements the drive base motors test. This test will spin each of the drive base motors at the specified drive power for the specified period of time.
  • Field Details

  • Constructor Details

    • CmdDriveMotorsTest

      public CmdDriveMotorsTest(TrcMotor[] motors, double driveTime, double drivePower)
      Constructor: Create an instance of the object.
      Parameters:
      motors - specifies the array of motors on the drive base.
      driveTime - specifies the amount of drive time in seconds.
      drivePower - specifies the motor power.
  • Method Details

    • isActive

      public boolean isActive()
      This method checks if the current RobotCommand is running.
      Specified by:
      isActive in interface TrcRobot.RobotCommand
      Returns:
      true if the command is running, false otherwise.
    • cancel

      public void cancel()
      This method cancels the command if it is active.
      Specified by:
      cancel in interface TrcRobot.RobotCommand
    • cmdPeriodic

      public boolean cmdPeriodic(double elapsedTime)
      This method must be called periodically by the caller to drive the command sequence forward.
      Specified by:
      cmdPeriodic in interface TrcRobot.RobotCommand
      Parameters:
      elapsedTime - specifies the elapsed time in seconds since the start of the robot mode.
      Returns:
      true if the command sequence is completed, false otherwise.
    • stopAllWheels

      private void stopAllWheels()
      This method stops all motors on the drive base.