View Single Post
  #5   Spotlight this post!  
Unread 26-01-2017, 21:03
Xavbro's Avatar
Xavbro Xavbro is offline
Registered User
AKA: Xavier Eldridge
FRC #5829 (Awtybots)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2016
Location: Houston, TX
Posts: 103
Xavbro is a splendid one to beholdXavbro is a splendid one to beholdXavbro is a splendid one to beholdXavbro is a splendid one to beholdXavbro is a splendid one to beholdXavbro is a splendid one to beholdXavbro is a splendid one to behold
Re: "Split Arcade" Drive with Xbox 360 Controller?

The type of drive you're asking for is very simple and we used it last year as a rookie team.

What you want to do is take one axis of the the controller and set it to straight and set the other axis of the controller to rotate.

***Java Code***
straight = (Robot.oi.xbox.getRawAxis(1));
rotate = (Robot.oi.xbox.getRawAxis(4));

We used an Xbox controller as well last year and found that the axis we wanted to use were 1 and 4. You'll have to double check with you team to see which ones you want to use.

After you've done that, you can tune the values for deadzones and such as needed. You would then use those values to apply to the drive motors as such:

leftMotor1.set((rotate + straight));
leftMotor2.set((rotate + straight));
rightMotor1.set(rotate - straight));
rightMotor2.set((rotate - straight));

(Of course if you're using more motors, you would add them. We only used 4.)

You might have to change the signs around to get the right direction and such but that's the code we used last year and it worked great.

If you have any questions, feel free to PM me. Hope this helps!
__________________


TigerBytes (FRC 4209): 2012-2013: Mentor
DiscoBots (FRC 2587): 2009: Member || 2010-2015: Mentor
Impact (FRC 2585): 2016-Present: Mentor
Awtybots (FRC 5829): 2015-Present: Mentor
Ri3D Team oRyon: 2014-Present: Programmer/Strategist
Reply With Quote