Allow passing DS Instance to Robot and OpModes#8626
Allow passing DS Instance to Robot and OpModes#8626ThadHouse wants to merge 30 commits intowpilibsuite:2027from
Conversation
Some discussion with the tech team showed that there were some real advantages to being able to pass a 2nd type. It allows separating the DS and Robot. Additionally, we can make the DriverStationBase class actually usable instead of the existing DriverStation class which is impossible to handle in intellisense because it has too much.
|
It think it would make more sense to name that something other than DriverStation(Base/Instance). I'm not sure what to name it, but the Driver Station isn't a (user configurable) collection of gamepads/high level user controller abstraction. |
|
Well a driver station is actually a user configurable collection of gamepads. Thats like the one user configurable thing. |
|
You mentioned there was an advantage to adding this additional layer of indirection, but it's not obvious what it is. |
|
It becomes more obvious what things are part of the DS, and what things are a part of the robot. It also gives a good place to put driver station specific code, like alliance flipping if a team wants to handle that. It also gives a uniform place to store all gamepad and joystick instances, which with opmodes becomes more important because we want to limit to a single instance, and we can imagine teams putting joysticks inside each opmode. Which we want to avoid. |
wpilibj/src/main/java/org/wpilib/driverstation/UserControls.java
Outdated
Show resolved
Hide resolved
|
It seems like the UserControls bits should be a separate PR from the refactor of the constructor matching? Also needs a C++ version of UserControls. |
Some discussion with the tech team showed that there were some real advantages to being able to pass a 2nd type. It allows separating the DS and Robot. Additionally, we can make the DriverStationBase class actually usable instead of the existing DriverStation class which is impossible to handle in intellisense because it has too much.
This won't fully be doable in C++, but we will need to implement something similar in python.