You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Matt Soucy edited this page Mar 25, 2022
·
1 revision
Chop Shop code uses wrappers around the WPIlib classes.
Controllers
The main wrapper, ButtonXboxController, adds buttons such as a(), b(), lbumper(), rstick(), povUp(), etc. to the WPIlib XboxController class.
These buttons provide JoystickButton objects, but also cache them so you're getting the same object each time the function is called.
In addition, the objects are only created if requested.
Triggers
We add one additional Trigger to WPIlib's concepts:
AxisButton returns true if the given axis on the given controller is above 0.5, or if the given predicate is true about its value.
Callbacks
CallbackUtils provides a handful of functions to tie a consumer into Network Tables.
The register function provides ways to associate a table and key name, with a callback to run when the value changes.