File tree Expand file tree Collapse file tree
src/main/java/org/carlmontrobotics/lib199 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import java .util .concurrent .CopyOnWriteArrayList ;
44import java .util .function .Consumer ;
55
6- import edu .wpi .first .wpilibj . RobotBase ;
6+ import edu .wpi .first .networktables . NetworkTableInstance ;
77import edu .wpi .first .wpilibj2 .command .Subsystem ;
88
99public class Lib199Subsystem implements Subsystem {
@@ -27,6 +27,15 @@ private static void ensureRegistered() {
2727 return ;
2828 }
2929 registered = true ;
30+
31+ // Regularly request a HALSimWS connection from the DeepBlueSim controller (if/when it is
32+ // listening). To workaround https://github.com/wpilibsuite/allwpilib/issues/6842, this must
33+ // be done *after* any SimDevices have been created (like those used to support simulation
34+ // of many of the devices in lib199).
35+ var reqPublisher = NetworkTableInstance .getDefault ()
36+ .getStringTopic ("/DeepBlueSim/Coordinator/request" ).publish ();
37+ registerSimulationPeriodic (() -> reqPublisher .set ("connectHALSimWS" ));
38+
3039 INSTANCE .register ();
3140 }
3241
You can’t perform that action at this time.
0 commit comments