View Single Post
  #2   Spotlight this post!  
Unread 19-01-2016, 16:08
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 217
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Tank drive on Xbox Controller

Quote:
Originally Posted by onenerdyguy View Post
I'm having difficulty getting a tank drive up and running on an Xbox controller. For some reason, it won't detect the right stick.

according to the driver station, our right stick Y axis is axis 5. My code is as follows:

self.leftstick = wpilib.Joystick(0,1)
self.rightstick = wpilib.Joystick(0,5)

The drive code is the very simple
self.myRobot.tankDrive(self.leftStick, self.rightStick)


The left stick works fine. Right stick doesn't even appear. Is there something I'm missing?
For us, the way the right stick worked was by doing self.joystick.getRawAxis(x) and self.joystick.getRawAxis(y) IN the teleop period. Our self.joystick was defined as self.joystick = wpilib.Joystick(0) IN the robotinit().

Replace the X and Y in the arguments with 5 or whatever number that shows up in your dashboard.
Reply With Quote