View Single Post
  #5   Spotlight this post!  
Unread 09-02-2016, 09:36
geniusadam69 geniusadam69 is offline
Registered User
FRC #5923
 
Join Date: Feb 2016
Location: Houston, TX
Posts: 5
geniusadam69 is an unknown quantity at this point
Re: RobotDrive with left joystick only? (XboxController)

The arcade drive method has a lot of different parameters sets, including (double move, double rotate) and (GenericHID stick).

The arcadeDrive(GenericHID stick) method requires a GenericHID item, which Joystick is. Since your xboxController is a Joystick and Joystick extends GenericHID, then this is the method you're calling. What we found is that using an Xbox Controller and declaring it as Joystick will result in only the left joystick being recognized directly. The right joystick is available, but it's buried deeper. So, your current method will work just fine for arcade drive.

The better way to use an Xbox Controller is to write your own class called XboxController and provide methods to access all of the features of the controller. Typically you will provide a double back for the joystick positions like MaraiGG used. Then you can expose both joysticks in a clean way. You'll then use the other parameter set: arcadeDrive(double move, double rotate)

Last edited by geniusadam69 : 09-02-2016 at 09:49. Reason: read the original question more and thought to provide a more clear answer.
Reply With Quote