Another fun thing that isn’t quite as useful, there’s a utility class for matrix math that has a method for matrix exponentiation (Java, I don’t think there’s a C++ implementation. WPILibc uses Eigen which already has an expm(), but Java’s EJML doesn’t)
I wouldn’t really call support for it a “wrapper”. There’s Joystick and XboxController classes, but no GuitarHeroController class. GenericHID does have kXInputGuitar though (they all enumerate through Windows’s XInput), so making a wrapper would just be a matter of making an API that maps to the buttons and axes to human-readable names. It wouldn’t be that hard to write. I would be very amused by a PR containing the mappings.
I’m always surprised by how few teams know the following exists. WPILib’s HID classes like Joystick and XboxController have getButtonPressed() and getButtonReleased() methods. This lets you trigger actions once when a button goes from pressed to released or vice versa in two lines of code; the code reads basically how you’d describe it in English. (No more flip-flopping booleans to keep track of the button state!)
pubilc class Robot extends TimedRobot {
private XboxController controller = new XboxController(0);
private Solenoid intakeStower = new Solenoid(0);
@Override
public teleopPeriodic() {
// Toggle a solenoid when a button is pressed
if (controller.getAButtonPressed()) {
intakeStower.set(!intakeStower.get());
}
}
}