Joystick values freezing while operating robot

Occasionally, while attempting to read the values from the joysticks, the values will “freeze”, no matter what positions we set the joysticks to the values being read are constant. The values are displayed accurately on the “USB Devices” tab of the FRC DriverStation, but they cannot be accessed from our code and not showing on shuffleboard. This usually happens in the first few seconds after enabling the robot.

We are using Thrustmaster joysticks connected via USB to our laptop.

1 Like

I’ve already reported this issue couple of days ago: Sometimes the controller doesn't respond

See also https://github.com/wpilibsuite/allwpilib/issues/3896 for potential upcoming fix

Ah glad it’s not just us having this problem. This happened to us once and we had no idea why. Couldn’t reproduce it.

We’ll create a more official thread when we have the update released, but yes there is an issue where joysticks will stop responding. Its exclusive to Java programs. We will have a WPILib update soon, and it will likely be a mandatory update for all teams running Java, as it is a safety issue. There is no real workaround right now without a new WPILib release.

2 Likes

As a future update or enhancement, could there be a way to report a joystick as disconnected if its data hasn’t been updated recently? Maybe it wouldn’t be necessary after this update, but just wanted to throw the idea out there of some extra precaution.

Normally, a team could write a code to do that. At the WPILib layer, we don’t know which joysticks are in use, so its hard for us to do something like that. Now that likely wouldn’t help this case, as this was a bug before joysticks hit user code in WPILib itself (Well actually it was a JDK bug cause the DS cache update thread to deadlock).

Also of note, the whole DS thread will be gone for 2023, we plan on removing it entirely and implementing its behavior in a much different way.

@Thad_House I think this is at least the third time in as many years that my programmers have struggled with something for hours, and I then go home that night to search CD, finding a response by you saying “known issue, will be fixed soon”. I want to say thank you for reading and contributing here on CD - you have helped us avoid many more hours of thinking we’re nuts and undergoing many more hours of troubleshooting. (I should probably also keep an eye on GitHub issues more often!)

5 Likes

This fix for this was included in WPILib 2022.2.1, released last night

2 Likes