Class DSControlWord

java.lang.Object
edu.wpi.first.wpilibj.DSControlWord

public class DSControlWord
extends Object
A wrapper around Driver Station control word.
  • Constructor Summary

    Constructors 
    Constructor Description
    DSControlWord()
    DSControlWord constructor.
  • Method Summary

    Modifier and Type Method Description
    boolean isAutonomous()
    Gets a value indicating whether the Driver Station requires the robot to be running in autonomous mode.
    boolean isAutonomousEnabled()
    Gets a value indicating whether the Driver Station requires the robot to be running in autonomous mode and enabled.
    boolean isDisabled()
    Gets a value indicating whether the Driver Station requires the robot to be disabled.
    boolean isDSAttached()
    Gets a value indicating whether the Driver Station is attached.
    boolean isEnabled()
    Gets a value indicating whether the Driver Station requires the robot to be enabled.
    boolean isEStopped()
    Gets a value indicating whether the Robot is e-stopped.
    boolean isFMSAttached()
    Gets if the driver station attached to a Field Management System.
    boolean isTeleop()
    Gets a value indicating whether the Driver Station requires the robot to be running in operator-controlled mode.
    boolean isTeleopEnabled()
    Gets a value indicating whether the Driver Station requires the robot to be running in operator-controller mode and enabled.
    boolean isTest()
    Gets a value indicating whether the Driver Station requires the robot to be running in test mode.
    void refresh()
    Update internal Driver Station control word.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DSControlWord

      public DSControlWord()
      DSControlWord constructor.

      Upon construction, the current Driver Station control word is read and stored internally.

  • Method Details

    • refresh

      public void refresh()
      Update internal Driver Station control word.
    • isEnabled

      public boolean isEnabled()
      Gets a value indicating whether the Driver Station requires the robot to be enabled.
      Returns:
      True if the robot is enabled, false otherwise.
    • isDisabled

      public boolean isDisabled()
      Gets a value indicating whether the Driver Station requires the robot to be disabled.
      Returns:
      True if the robot should be disabled, false otherwise.
    • isEStopped

      public boolean isEStopped()
      Gets a value indicating whether the Robot is e-stopped.
      Returns:
      True if the robot is e-stopped, false otherwise.
    • isAutonomous

      public boolean isAutonomous()
      Gets a value indicating whether the Driver Station requires the robot to be running in autonomous mode.
      Returns:
      True if autonomous mode should be enabled, false otherwise.
    • isAutonomousEnabled

      public boolean isAutonomousEnabled()
      Gets a value indicating whether the Driver Station requires the robot to be running in autonomous mode and enabled.
      Returns:
      True if autonomous should be set and the robot should be enabled.
    • isTeleop

      public boolean isTeleop()
      Gets a value indicating whether the Driver Station requires the robot to be running in operator-controlled mode.
      Returns:
      True if operator-controlled mode should be enabled, false otherwise.
    • isTeleopEnabled

      public boolean isTeleopEnabled()
      Gets a value indicating whether the Driver Station requires the robot to be running in operator-controller mode and enabled.
      Returns:
      True if operator-controlled mode should be set and the robot should be enabled.
    • isTest

      public boolean isTest()
      Gets a value indicating whether the Driver Station requires the robot to be running in test mode.
      Returns:
      True if test mode should be enabled, false otherwise.
    • isDSAttached

      public boolean isDSAttached()
      Gets a value indicating whether the Driver Station is attached.
      Returns:
      True if Driver Station is attached, false otherwise.
    • isFMSAttached

      public boolean isFMSAttached()
      Gets if the driver station attached to a Field Management System.
      Returns:
      true if the robot is competing on a field being controlled by a Field Management System