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.booleanGets a value indicating whether the Driver Station requires the robot to be running in utility mode.booleanGets a value indicating whether the Driver Station requires the robot to be running in utility 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
public void update(long word) Updates from the native HAL value.- Parameters:
word- value
-
update
Updates from an existing word.- Parameters:
word- word to update from
-
getOpModeId
public long getOpModeId()Gets the opmode ID.- Returns:
- the opmode ID
-
setOpModeId
public void setOpModeId(long id) Sets the opmode ID.- Parameters:
id- opmode ID
-
getRobotMode
-
isEnabled
public boolean isEnabled()Gets the Enabled flag.- Returns:
- the Enabled flag
-
isEStopped
public boolean isEStopped()Gets the E-Stop flag.- Returns:
- the E-Stop flag
-
isFMSAttached
public boolean isFMSAttached()Gets the FMS attached flag.- Returns:
- the FMS attached flag
-
isDSAttached
public boolean isDSAttached()Gets the DS attached flag.- Returns:
- the DS attached flag
-
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.
-
isUtility
public boolean isUtility()Gets a value indicating whether the Driver Station requires the robot to be running in utility mode.- Returns:
- True if utility mode should be enabled, false otherwise.
-
isUtilityEnabled
public boolean isUtilityEnabled()Gets a value indicating whether the Driver Station requires the robot to be running in utility mode and enabled.- Returns:
- True if utility mode should be set and the robot should be enabled.
-
getNative
public long getNative()Gets the native HAL control word value.- Returns:
- control word value
-
equals
-
hashCode
-