mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Split DriverStation into smaller classes (#8628)
This commit is contained in:
@@ -105,8 +105,15 @@ MecanumDrive = "wpi/drive/MecanumDrive.hpp"
|
||||
RobotDriveBase = "wpi/drive/RobotDriveBase.hpp"
|
||||
|
||||
# wpi/driverstation
|
||||
DriverStationBackend = "wpi/driverstation/internal/DriverStationBackend.hpp"
|
||||
Alliance = "wpi/driverstation/Alliance.hpp"
|
||||
Alert = "wpi/driverstation/Alert.hpp"
|
||||
DriverStation = "wpi/driverstation/DriverStation.hpp"
|
||||
MatchState = "wpi/driverstation/MatchState.hpp"
|
||||
MatchType = "wpi/driverstation/MatchType.hpp"
|
||||
POVDirection = "wpi/driverstation/POVDirection.hpp"
|
||||
RobotState = "wpi/driverstation/RobotState.hpp"
|
||||
TouchpadFinger = "wpi/driverstation/TouchpadFinger.hpp"
|
||||
Gamepad = "wpi/driverstation/Gamepad.hpp"
|
||||
GenericHID = "wpi/driverstation/GenericHID.hpp"
|
||||
Joystick = "wpi/driverstation/Joystick.hpp"
|
||||
|
||||
2
wpilibc/src/main/python/semiwrap/Alliance.yml
Normal file
2
wpilibc/src/main/python/semiwrap/Alliance.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
enums:
|
||||
Alliance:
|
||||
@@ -1,82 +1,12 @@
|
||||
extra_includes:
|
||||
- wpi/datalog/DataLog.hpp
|
||||
- wpi/util/Color.hpp
|
||||
|
||||
classes:
|
||||
wpi::DriverStation:
|
||||
attributes:
|
||||
JOYSTICK_PORTS:
|
||||
enums:
|
||||
Alliance:
|
||||
MatchType:
|
||||
POVDirection:
|
||||
methods:
|
||||
GetStickButton:
|
||||
GetStickButtonPressed:
|
||||
GetStickButtonReleased:
|
||||
GetStickAxis:
|
||||
GetStickPOV:
|
||||
GetStickButtons:
|
||||
GetJoystickGamepadType:
|
||||
GetJoystickSupportedOutputs:
|
||||
GetJoystickName:
|
||||
IsJoystickConnected:
|
||||
IsEnabled:
|
||||
IsDisabled:
|
||||
IsEStopped:
|
||||
IsAutonomous:
|
||||
IsAutonomousEnabled:
|
||||
IsTeleop:
|
||||
IsTeleopEnabled:
|
||||
IsTest:
|
||||
IsTestEnabled:
|
||||
IsDSAttached:
|
||||
IsFMSAttached:
|
||||
GetGameData:
|
||||
GetEventName:
|
||||
GetMatchType:
|
||||
GetMatchNumber:
|
||||
GetReplayNumber:
|
||||
GetAlliance:
|
||||
GetLocation:
|
||||
GetMatchTime:
|
||||
GetBatteryVoltage:
|
||||
RefreshData:
|
||||
ProvideRefreshedDataEventHandle:
|
||||
RemoveRefreshedDataEventHandle:
|
||||
SilenceJoystickConnectionWarning:
|
||||
IsJoystickConnectionWarningSilenced:
|
||||
StartDataLog:
|
||||
GetAngle:
|
||||
GetJoystickIsGamepad:
|
||||
GetStickButtonIfAvailable:
|
||||
GetStickAxisIfAvailable:
|
||||
GetStickAxesMaximumIndex:
|
||||
GetStickAxesAvailable:
|
||||
GetStickPOVsMaximumIndex:
|
||||
GetStickPOVsAvailable:
|
||||
GetStickButtonsMaximumIndex:
|
||||
GetStickButtonsAvailable:
|
||||
GetRobotMode:
|
||||
AddOpMode:
|
||||
overloads:
|
||||
RobotMode, std::string_view, std::string_view, std::string_view:
|
||||
RobotMode, std::string_view, std::string_view, std::string_view, const wpi::util::Color&, const wpi::util::Color&:
|
||||
RemoveOpMode:
|
||||
PublishOpModes:
|
||||
ClearOpModes:
|
||||
GetOpModeId:
|
||||
GetOpMode:
|
||||
IsOpMode:
|
||||
overloads:
|
||||
int64_t:
|
||||
std::string_view:
|
||||
GetControlWord:
|
||||
GetStickTouchpadFinger:
|
||||
GetStickTouchpadFingerAvailable:
|
||||
ObserveUserProgramStarting:
|
||||
wpi::DriverStation::TouchpadFinger:
|
||||
attributes:
|
||||
down:
|
||||
x:
|
||||
y:
|
||||
wpi::log::DataLog&:
|
||||
wpi::log::DataLog&, bool:
|
||||
|
||||
72
wpilibc/src/main/python/semiwrap/DriverStationBackend.yml
Normal file
72
wpilibc/src/main/python/semiwrap/DriverStationBackend.yml
Normal file
@@ -0,0 +1,72 @@
|
||||
extra_includes:
|
||||
- wpi/datalog/DataLog.hpp
|
||||
- wpi/util/Color.hpp
|
||||
|
||||
classes:
|
||||
wpi::internal::DriverStationBackend:
|
||||
attributes:
|
||||
JOYSTICK_PORTS:
|
||||
methods:
|
||||
GetStickButton:
|
||||
GetStickButtonIfAvailable:
|
||||
GetStickButtonPressed:
|
||||
GetStickButtonReleased:
|
||||
GetStickAxis:
|
||||
GetStickTouchpadFinger:
|
||||
GetStickTouchpadFingerAvailable:
|
||||
GetStickAxisIfAvailable:
|
||||
GetStickPOV:
|
||||
GetStickButtons:
|
||||
GetStickAxesMaximumIndex:
|
||||
GetStickAxesAvailable:
|
||||
GetStickPOVsMaximumIndex:
|
||||
GetStickPOVsAvailable:
|
||||
GetStickButtonsMaximumIndex:
|
||||
GetStickButtonsAvailable:
|
||||
GetJoystickIsGamepad:
|
||||
GetJoystickGamepadType:
|
||||
GetJoystickSupportedOutputs:
|
||||
GetJoystickName:
|
||||
IsJoystickConnected:
|
||||
IsEnabled:
|
||||
IsDisabled:
|
||||
IsEStopped:
|
||||
GetRobotMode:
|
||||
IsAutonomous:
|
||||
IsAutonomousEnabled:
|
||||
IsTeleop:
|
||||
IsTeleopEnabled:
|
||||
IsTest:
|
||||
IsTestEnabled:
|
||||
AddOpMode:
|
||||
overloads:
|
||||
RobotMode, std::string_view, std::string_view, std::string_view, const wpi::util::Color&, const wpi::util::Color&:
|
||||
RobotMode, std::string_view, std::string_view, std::string_view:
|
||||
RemoveOpMode:
|
||||
PublishOpModes:
|
||||
ClearOpModes:
|
||||
GetOpModeId:
|
||||
GetOpMode:
|
||||
IsOpMode:
|
||||
overloads:
|
||||
int64_t:
|
||||
std::string_view:
|
||||
IsDSAttached:
|
||||
IsFMSAttached:
|
||||
GetGameData:
|
||||
GetEventName:
|
||||
GetMatchType:
|
||||
GetMatchNumber:
|
||||
GetReplayNumber:
|
||||
GetAlliance:
|
||||
GetLocation:
|
||||
GetMatchTime:
|
||||
GetBatteryVoltage:
|
||||
GetControlWord:
|
||||
RefreshData:
|
||||
ProvideRefreshedDataEventHandle:
|
||||
RemoveRefreshedDataEventHandle:
|
||||
SilenceJoystickConnectionWarning:
|
||||
IsJoystickConnectionWarningSilenced:
|
||||
StartDataLog:
|
||||
ObserveUserProgramStarting:
|
||||
@@ -1,5 +1,5 @@
|
||||
extra_includes:
|
||||
- wpi/driverstation/DriverStation.hpp
|
||||
- wpi/driverstation/internal/DriverStationBackend.hpp
|
||||
- wpi/event/BooleanEvent.hpp
|
||||
|
||||
classes:
|
||||
@@ -19,8 +19,8 @@ classes:
|
||||
GetPOV:
|
||||
POV:
|
||||
overloads:
|
||||
DriverStation::POVDirection, EventLoop* [const]:
|
||||
int, DriverStation::POVDirection, EventLoop* [const]:
|
||||
POVDirection, EventLoop* [const]:
|
||||
int, POVDirection, EventLoop* [const]:
|
||||
POVUp:
|
||||
POVUpRight:
|
||||
POVRight:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extra_includes:
|
||||
- wpi/driverstation/DriverStation.hpp
|
||||
- wpi/driverstation/internal/DriverStationBackend.hpp
|
||||
|
||||
classes:
|
||||
wpi::Joystick:
|
||||
|
||||
11
wpilibc/src/main/python/semiwrap/MatchState.yml
Normal file
11
wpilibc/src/main/python/semiwrap/MatchState.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
classes:
|
||||
wpi::MatchState:
|
||||
methods:
|
||||
GetMatchTime:
|
||||
GetAlliance:
|
||||
GetLocation:
|
||||
GetReplayNumber:
|
||||
GetMatchNumber:
|
||||
GetMatchType:
|
||||
GetEventName:
|
||||
GetGameData:
|
||||
2
wpilibc/src/main/python/semiwrap/MatchType.yml
Normal file
2
wpilibc/src/main/python/semiwrap/MatchType.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
enums:
|
||||
MatchType:
|
||||
@@ -1,6 +1,6 @@
|
||||
extra_includes:
|
||||
- wpi/util/sendable/SendableBuilder.hpp
|
||||
- wpi/driverstation/DriverStation.hpp
|
||||
- wpi/driverstation/internal/DriverStationBackend.hpp
|
||||
- wpi/event/BooleanEvent.hpp
|
||||
|
||||
classes:
|
||||
|
||||
4
wpilibc/src/main/python/semiwrap/POVDirection.yml
Normal file
4
wpilibc/src/main/python/semiwrap/POVDirection.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
enums:
|
||||
POVDirection:
|
||||
functions:
|
||||
GetPOVAngle:
|
||||
@@ -1,5 +1,5 @@
|
||||
extra_includes:
|
||||
- wpi/driverstation/DriverStation.hpp
|
||||
- wpi/driverstation/internal/DriverStationBackend.hpp
|
||||
|
||||
functions:
|
||||
# TODO
|
||||
|
||||
31
wpilibc/src/main/python/semiwrap/RobotState.yml
Normal file
31
wpilibc/src/main/python/semiwrap/RobotState.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
extra_includes:
|
||||
- wpi/util/Color.hpp
|
||||
|
||||
classes:
|
||||
wpi::RobotState:
|
||||
methods:
|
||||
IsEnabled:
|
||||
IsDisabled:
|
||||
IsEStopped:
|
||||
GetRobotMode:
|
||||
IsAutonomous:
|
||||
IsAutonomousEnabled:
|
||||
IsTeleop:
|
||||
IsTeleopEnabled:
|
||||
IsTest:
|
||||
IsTestEnabled:
|
||||
AddOpMode:
|
||||
overloads:
|
||||
RobotMode, std::string_view, std::string_view, std::string_view, const wpi::util::Color&, const wpi::util::Color&:
|
||||
RobotMode, std::string_view, std::string_view, std::string_view:
|
||||
RemoveOpMode:
|
||||
PublishOpModes:
|
||||
ClearOpModes:
|
||||
GetOpModeId:
|
||||
GetOpMode:
|
||||
IsOpMode:
|
||||
overloads:
|
||||
int64_t:
|
||||
std::string_view:
|
||||
IsDSAttached:
|
||||
IsFMSAttached:
|
||||
6
wpilibc/src/main/python/semiwrap/TouchpadFinger.yml
Normal file
6
wpilibc/src/main/python/semiwrap/TouchpadFinger.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
classes:
|
||||
wpi::TouchpadFinger:
|
||||
attributes:
|
||||
down:
|
||||
x:
|
||||
y:
|
||||
@@ -10,8 +10,8 @@ classes:
|
||||
SetRawAxis:
|
||||
SetPOV:
|
||||
overloads:
|
||||
int, DriverStation::POVDirection:
|
||||
DriverStation::POVDirection:
|
||||
int, POVDirection:
|
||||
POVDirection:
|
||||
SetGamepadType:
|
||||
SetSupportedOutputs:
|
||||
SetName:
|
||||
|
||||
@@ -21,6 +21,7 @@ from ._wpilib import (
|
||||
DigitalOutput,
|
||||
DoubleSolenoid,
|
||||
DriverStation,
|
||||
DriverStationBackend,
|
||||
DutyCycle,
|
||||
DutyCycleEncoder,
|
||||
EdgeConfiguration,
|
||||
@@ -39,6 +40,7 @@ from ._wpilib import (
|
||||
Joystick,
|
||||
Koors40,
|
||||
LEDPattern,
|
||||
MatchState,
|
||||
MecanumDrive,
|
||||
Mechanism2d,
|
||||
MechanismLigament2d,
|
||||
@@ -72,6 +74,7 @@ from ._wpilib import (
|
||||
RobotBase,
|
||||
RobotController,
|
||||
RobotDriveBase,
|
||||
RobotState,
|
||||
RuntimeType,
|
||||
SendableBuilderImpl,
|
||||
SendableChooser,
|
||||
@@ -124,6 +127,7 @@ __all__ = [
|
||||
"DigitalOutput",
|
||||
"DoubleSolenoid",
|
||||
"DriverStation",
|
||||
"DriverStationBackend",
|
||||
"DutyCycle",
|
||||
"DutyCycleEncoder",
|
||||
"EdgeConfiguration",
|
||||
@@ -142,6 +146,7 @@ __all__ = [
|
||||
"Joystick",
|
||||
"Koors40",
|
||||
"LEDPattern",
|
||||
"MatchState",
|
||||
"MecanumDrive",
|
||||
"Mechanism2d",
|
||||
"MechanismLigament2d",
|
||||
@@ -173,6 +178,7 @@ __all__ = [
|
||||
"PowerDistribution",
|
||||
"Preferences",
|
||||
"RobotBase",
|
||||
"RobotState",
|
||||
"RobotController",
|
||||
"RobotDriveBase",
|
||||
"RuntimeType",
|
||||
|
||||
@@ -189,8 +189,8 @@ class RobotStarter:
|
||||
|
||||
wpilib.SmartDashboard.init()
|
||||
|
||||
# Call DriverStation.refreshData() to kick things off
|
||||
wpilib.DriverStation.refreshData()
|
||||
# Call DriverStationBackend.refreshData() to kick things off
|
||||
wpilib.DriverStationBackend.refreshData()
|
||||
|
||||
try:
|
||||
self.robot = robot_cls()
|
||||
|
||||
@@ -73,7 +73,7 @@ class RobotTestingPlugin:
|
||||
pauseTiming()
|
||||
restartTiming()
|
||||
|
||||
wpilib.DriverStation.silenceJoystickConnectionWarning(True)
|
||||
wpilib.DriverStationBackend.silenceJoystickConnectionWarning(True)
|
||||
DriverStationSim.setRobotMode(RobotMode.AUTONOMOUS)
|
||||
DriverStationSim.setEnabled(False)
|
||||
DriverStationSim.notifyNewData()
|
||||
|
||||
Reference in New Issue
Block a user