View Single Post
  #3   Spotlight this post!  
Unread 14-01-2017, 21:18
calcmogul's Avatar
calcmogul calcmogul is offline
WPILib Developer
AKA: Tyler Veness
FRC #3512 (Spartatroniks)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Santa Maria, CA
Posts: 52
calcmogul is just really nicecalcmogul is just really nicecalcmogul is just really nicecalcmogul is just really nice
Re: Simple library for XBox controllers

My initial implementation of the XboxController class was based on https://github.com/robotdotnet/WPILi...xController.cs. I replaced the base classes with GamepadBase and JoystickBase to deduplicate the implementations of Joystick and XboxController.

I also wrote a button state tracker for Joysticks a few years ago that I submitted this year (https://github.com/wpilibsuite/allwpilib/pull/89). It's intended to be used with SampleRobot since Command-based robots already have the capability to run commands upon button state edges (see the ButtonScheduler commands). It wasn't merged in time for 2017 because we had other concerns to focus on for release. It uses raw button numbers, so using it for an XboxController wouldn't be clean. Perhaps an enum could be used to map the button names (A, B, X, Y) to the raw button number.
Reply With Quote