[wpilib] Make joystick unplugged warning better in cases of out of range axis/button (#8614)

Closes #8594 
Fixes #7700 
Also fixes DS HAL to zero out joysticks not received from DS.
This commit is contained in:
Ryan Blue
2026-02-17 23:22:02 -05:00
committed by GitHub
parent 10fa2fced4
commit 0c44e63465
4 changed files with 74 additions and 87 deletions

View File

@@ -65,15 +65,12 @@ INSTANTIATE_TEST_SUITE_P(
DriverStationTests, JoystickConnectionWarningTest,
::testing::Values(
std::make_tuple(false, true, true, ""),
std::make_tuple(
false, false, false,
"Warning: Joystick Button 1 missing (available 0), check if all "
"controllers are plugged in\n"),
std::make_tuple(
true, true, false,
"Warning: Joystick Button 1 missing (available 0), check if all "
"controllers are plugged in\n"),
std::make_tuple(
true, false, false,
"Warning: Joystick Button 1 missing (available 0), check if all "
"controllers are plugged in\n")));
std::make_tuple(false, false, false,
"Warning: Joystick on port 0 not available, check if "
"all controllers are plugged in\n"),
std::make_tuple(true, true, false,
"Warning: Joystick on port 0 not available, check if "
"all controllers are plugged in\n"),
std::make_tuple(true, false, false,
"Warning: Joystick on port 0 not available, check if "
"all controllers are plugged in\n")));