A wrapper around Driver Station control word.
More...
#include <wpi/hal/DriverStationTypes.hpp>
|
| | ControlWord ()=default |
| | Default constructor.
|
| | ControlWord (int64_t opModeHash, RobotMode robotMode, bool enabled, bool eStop, bool fmsAttached, bool dsAttached) |
| | Constructs from state values.
|
| | ControlWord (HAL_ControlWord word) |
| | Constructs from the native HAL value.
|
| | ControlWord (const ControlWord &)=default |
| ControlWord & | operator= (const ControlWord &)=default |
| void | Update (int64_t opModeHash, RobotMode robotMode, bool enabled, bool eStop, bool fmsAttached, bool dsAttached) |
| | Updates from state values.
|
| void | Update (HAL_ControlWord word) |
| | Updates from the native HAL value.
|
| bool | IsEnabled () const |
| | Check if the DS has enabled the robot.
|
| RobotMode | GetRobotMode () const |
| | Gets the current robot mode.
|
| int64_t | GetOpModeId () const |
| | Gets the current opmode ID.
|
| void | SetOpModeId (int64_t id) |
| | Sets the opmode ID.
|
| bool | IsEStopped () const |
| | Check if the robot is e-stopped.
|
| bool | IsFMSAttached () const |
| | Is the driver station attached to a Field Management System?
|
| bool | IsDSAttached () const |
| | Check if the DS is attached.
|
| bool | IsAutonomous () const |
| | Check if the DS is commanding autonomous mode.
|
| bool | IsAutonomousEnabled () const |
| | Check if the DS is commanding autonomous mode and if it has enabled the robot.
|
| bool | IsTeleop () const |
| | Check if the DS is commanding teleop mode.
|
| bool | IsTeleopEnabled () const |
| | Check if the DS is commanding teleop mode and if it has enabled the robot.
|
| bool | IsTest () const |
| | Check if the DS is commanding test mode.
|
| bool | IsTestEnabled () const |
| | Check if the DS is commanding test mode and if it has enabled the robot.
|
| HAL_ControlWord | GetValue () const |
| | Get the HAL raw value.
|
A wrapper around Driver Station control word.
◆ ControlWord() [1/4]
| wpi::hal::ControlWord::ControlWord |
( |
| ) |
|
|
default |
◆ ControlWord() [2/4]
| wpi::hal::ControlWord::ControlWord |
( |
int64_t | opModeHash, |
|
|
RobotMode | robotMode, |
|
|
bool | enabled, |
|
|
bool | eStop, |
|
|
bool | fmsAttached, |
|
|
bool | dsAttached ) |
|
inline |
Constructs from state values.
- Parameters
-
| opModeHash | opmode hash |
| robotMode | robot mode |
| enabled | enabled |
| eStop | emergency stopped |
| fmsAttached | FMS attached |
| dsAttached | DS attached |
◆ ControlWord() [3/4]
Constructs from the native HAL value.
- Parameters
-
◆ ControlWord() [4/4]
| wpi::hal::ControlWord::ControlWord |
( |
const ControlWord & | | ) |
|
|
default |
◆ GetOpModeId()
| int64_t wpi::hal::ControlWord::GetOpModeId |
( |
| ) |
const |
|
inline |
Gets the current opmode ID.
- Returns
- opmode
◆ GetRobotMode()
| RobotMode wpi::hal::ControlWord::GetRobotMode |
( |
| ) |
const |
|
inline |
Gets the current robot mode.
Note that this does not indicate whether the robot is enabled or disabled.
- Returns
- robot mode
◆ GetValue()
Get the HAL raw value.
- Returns
- Control word value
◆ IsAutonomous()
| bool wpi::hal::ControlWord::IsAutonomous |
( |
| ) |
const |
|
inline |
Check if the DS is commanding autonomous mode.
- Returns
- True if the robot is being commanded to be in autonomous mode
◆ IsAutonomousEnabled()
| bool wpi::hal::ControlWord::IsAutonomousEnabled |
( |
| ) |
const |
|
inline |
Check if the DS is commanding autonomous mode and if it has enabled the robot.
- Returns
- True if the robot is being commanded to be in autonomous mode and enabled.
◆ IsDSAttached()
| bool wpi::hal::ControlWord::IsDSAttached |
( |
| ) |
const |
|
inline |
Check if the DS is attached.
- Returns
- True if the DS is connected to the robot
◆ IsEnabled()
| bool wpi::hal::ControlWord::IsEnabled |
( |
| ) |
const |
|
inline |
Check if the DS has enabled the robot.
- Returns
- True if the robot is enabled and the DS is connected
◆ IsEStopped()
| bool wpi::hal::ControlWord::IsEStopped |
( |
| ) |
const |
|
inline |
Check if the robot is e-stopped.
- Returns
- True if the robot is e-stopped
◆ IsFMSAttached()
| bool wpi::hal::ControlWord::IsFMSAttached |
( |
| ) |
const |
|
inline |
Is 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
◆ IsTeleop()
| bool wpi::hal::ControlWord::IsTeleop |
( |
| ) |
const |
|
inline |
Check if the DS is commanding teleop mode.
- Returns
- True if the robot is being commanded to be in teleop mode
◆ IsTeleopEnabled()
| bool wpi::hal::ControlWord::IsTeleopEnabled |
( |
| ) |
const |
|
inline |
Check if the DS is commanding teleop mode and if it has enabled the robot.
- Returns
- True if the robot is being commanded to be in teleop mode and enabled.
◆ IsTest()
| bool wpi::hal::ControlWord::IsTest |
( |
| ) |
const |
|
inline |
Check if the DS is commanding test mode.
- Returns
- True if the robot is being commanded to be in test mode
◆ IsTestEnabled()
| bool wpi::hal::ControlWord::IsTestEnabled |
( |
| ) |
const |
|
inline |
Check if the DS is commanding test mode and if it has enabled the robot.
- Returns
- True if the robot is being commanded to be in test mode and enabled.
◆ operator=()
◆ SetOpModeId()
| void wpi::hal::ControlWord::SetOpModeId |
( |
int64_t | id | ) |
|
|
inline |
Sets the opmode ID.
- Parameters
-
◆ Update() [1/2]
Updates from the native HAL value.
- Parameters
-
◆ Update() [2/2]
| void wpi::hal::ControlWord::Update |
( |
int64_t | opModeHash, |
|
|
RobotMode | robotMode, |
|
|
bool | enabled, |
|
|
bool | eStop, |
|
|
bool | fmsAttached, |
|
|
bool | dsAttached ) |
|
inline |
Updates from state values.
- Parameters
-
| opModeHash | opmode hash |
| robotMode | robot mode |
| enabled | enabled |
| eStop | emergency stopped |
| fmsAttached | FMS attached |
| dsAttached | DS attached |
The documentation for this class was generated from the following file: