[wpilibc] Change DriverStationSim to use a C++ enum for alliance station (#8991)

This commit is contained in:
PJ Reiniger
2026-06-21 22:29:19 -04:00
committed by GitHub
parent af91ba39f2
commit 45d4ed5bca
8 changed files with 97 additions and 61 deletions

View File

@@ -9,6 +9,26 @@
namespace wpi::hal {
/**
* The alliance station ID.
*/
enum class AllianceStationID {
/// Unknown.
UNKNOWN = HAL_ALLIANCE_STATION_UNKNOWN,
/// Red Alliance Station 1.
RED_1 = HAL_ALLIANCE_STATION_RED_1,
/// Red Alliance Station 2.
RED_2 = HAL_ALLIANCE_STATION_RED_2,
/// Red Alliance Station 3.
RED_3 = HAL_ALLIANCE_STATION_RED_3,
/// Blue Alliance Station 1.
BLUE_1 = HAL_ALLIANCE_STATION_BLUE_1,
/// Blue Alliance Station 2.
BLUE_2 = HAL_ALLIANCE_STATION_BLUE_2,
/// Blue Alliance Station 3.
BLUE_3 = HAL_ALLIANCE_STATION_BLUE_3,
};
/**
* The overall robot mode (not including enabled state).
*/

View File

@@ -5,6 +5,7 @@ extra_includes:
- src/ds_types_fmt.h
enums:
AllianceStationID:
RobotMode:
classes:
wpi::hal::ControlWord:

View File

@@ -6,6 +6,7 @@ extra_includes:
enums:
HAL_AllianceStationID:
rename: _AllianceStationID
value_prefix: HAL_ALLIANCE_STATION
HAL_JoystickPOV:
value_prefix: HAL_JOYSTICK_POV