mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[hal, wpilib] Load joystick values upon code initialization (#4950)
During HAL_Initialize, wait up to 100ms for a DS packet to be received. Then in RobotBase, right after calling HAL_Initialize, call each language's RefreshData function to force a high level DS update. If the DS is connected, will get joystick data. If there is no data, nothing different will happen, but in that case there's no joysticks anyway.
This commit is contained in:
@@ -395,6 +395,9 @@ public abstract class RobotBase implements AutoCloseable {
|
||||
throw new IllegalStateException("Failed to initialize. Terminating");
|
||||
}
|
||||
|
||||
// Force refresh DS data
|
||||
DriverStation.refreshData();
|
||||
|
||||
// Call a CameraServer JNI function to force OpenCV native library loading
|
||||
// Needed because all the OpenCV JNI functions don't have built in loading
|
||||
CameraServerJNI.enumerateSinks();
|
||||
|
||||
Reference in New Issue
Block a user