Package trclib.command
Class CmdDriveMotorsTest
java.lang.Object
trclib.command.CmdDriveMotorsTest
- All Implemented Interfaces:
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.
-
Constructor Summary
ConstructorsConstructorDescriptionCmdDriveMotorsTest
(TrcMotor[] motors, double driveTime, double drivePower) Constructor: Create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
This method cancels the command if it is active.boolean
cmdPeriodic
(double elapsedTime) This method must be called periodically by the caller to drive the command sequence forward.boolean
isActive()
This method checks if the current RobotCommand is running.
-
Constructor Details
-
CmdDriveMotorsTest
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 interfaceTrcRobot.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 interfaceTrcRobot.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 interfaceTrcRobot.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.
-