Class ControlWord
java.lang.Object
org.wpilib.hardware.hal.ControlWord
A wrapper for the HALControlWord bitfield.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongGets the native HAL control word value.longGets the opmode ID.Gets the robot mode.inthashCode()booleanGets a value indicating whether the Driver Station requires the robot to be running in autonomous mode.booleanGets a value indicating whether the Driver Station requires the robot to be running in autonomous mode and enabled.booleanGets the DS attached flag.booleanGets the Enabled flag.booleanGets the E-Stop flag.booleanGets the FMS attached flag.booleanisTeleop()Gets a value indicating whether the Driver Station requires the robot to be running in operator-controlled mode.booleanGets a value indicating whether the Driver Station requires the robot to be running in operator-controller mode and enabled.booleanisTest()Gets a value indicating whether the Driver Station requires the robot to be running in test mode.booleanGets a value indicating whether the Driver Station requires the robot to be running in test mode and enabled.voidsetOpModeId(long id) Sets the opmode ID.voidupdate(long word) Updates from the native HAL value.voidupdate(long opModeHash, RobotMode robotMode, boolean enabled, boolean emergencyStop, boolean fmsAttached, boolean dsAttached) Updates from state values.voidupdate(ControlWord word) Updates from an existing word.
-
Field Details
-
struct
-
-
Constructor Details
-
ControlWord
public ControlWord()Default constructor.
-
-
Method Details
-
update
public void update(long opModeHash, RobotMode robotMode, boolean enabled, boolean emergencyStop, boolean fmsAttached, boolean dsAttached) Updates from state values.- Parameters:
opModeHash- opmode hashrobotMode- robot modeenabled- enabledemergencyStop- emergency stoppedfmsAttached- FMS attacheddsAttached- DS attached
-
update
-
update
Updates from an existing word.- Parameters:
word- word to update from
-
getOpModeId
-
setOpModeId
-
getRobotMode
-
isEnabled
-
isEStopped
-
isFMSAttached
-
isDSAttached
-
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
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
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
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
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.
-
isTestEnabled
Gets a value indicating whether the Driver Station requires the robot to be running in test mode and enabled.- Returns:
- True if test mode should be set and the robot should be enabled.
-
getNative
-
equals
-
hashCode
-