Go to Post IT ISN'T THE STUDENT'S JOB TO DISCIPLINE OTHER STUDENTS. That's why God invented mentors. Let them do their jobs. - Collin Fultz [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2017, 19:37
JoeyDaPanda's Avatar
JoeyDaPanda JoeyDaPanda is offline
Registered User
AKA: Joey
FRC #6324 (The Blue Devils)
Team Role: Programmer
 
Join Date: Nov 2016
Rookie Year: 2017
Location: Salem NH
Posts: 5
JoeyDaPanda is an unknown quantity at this point
Question "Split Arcade" Drive with Xbox 360 Controller?

Hey there, rookie team 6324 here. We have a pretty big dilemma, and we're hoping you guys can help us out some. We are inexperienced in programming and need guidance.

Like the title says, we would like to have the left joystick of an Xbox 360 controller control throttle and the right thumbstick of the controller control turning. We have no clue how to achieve this. Currently the right trigger controls the left side wheels/motors, and the Y axis of the left thumbstick controls the right side.

Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2017, 19:59
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is offline
Founder and CEO, DeadMemes Studios
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 419
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Re: "Split Arcade" Drive with Xbox 360 Controller?

Code:
robot_drive.arcadeDrive(xboxController.getY(Hand.kLeft), xboxController.getX(Hand.kRight));


This is assuming you've already made a RobotDrive object and an XboxController object, and that you are using Java.
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder


Reply With Quote
  #3   Spotlight this post!  
Unread 26-01-2017, 20:09
ben47955 ben47955 is offline
Registered User
FRC #3996 (RIKITIK)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Canada
Posts: 14
ben47955 is an unknown quantity at this point
Re: "Split Arcade" Drive with Xbox 360 Controller?

I don't recommand to a team inexperienced in programming to try two type of drive. Focus on one and do well ( pratice your driver too).

But, if you really want to do this, I recommand to uses a toggle button for switch mode. It will be more simple to programming and robot will don't go in all ways.
Reply With Quote
  #4   Spotlight this post!  
Unread 26-01-2017, 21:02
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is offline
Founder and CEO, DeadMemes Studios
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 419
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Re: "Split Arcade" Drive with Xbox 360 Controller?

Quote:
Originally Posted by ben47955 View Post
I don't recommand to a team inexperienced in programming to try two type of drive. Focus on one and do well ( pratice your driver too).

But, if you really want to do this, I recommand to uses a toggle button for switch mode. It will be more simple to programming and robot will don't go in all ways.
I don't think that they wanted to do two types of drive, I think they wanted to figure out how to do the one they wanted. That being said, I don't think arcade drive is too complicated for any team to understand. It's one of the easier things to implement, especially since it's so well documented.
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder


Reply With Quote
  #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
  #6   Spotlight this post!  
Unread 26-01-2017, 21:41
messer5740's Avatar
messer5740 messer5740 is offline
Registered User
FRC #5740 (Trojanators)
Team Role: Driver
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Pittsburgh
Posts: 142
messer5740 is an unknown quantity at this point
Re: "Split Arcade" Drive with Xbox 360 Controller?

Also, be mindful of the Xbox controller Axes. You can find them in the driver station USB panel.
__________________
A good driver is always better than a good robot.

2015: Winner of the Rookie Inspiration Award
2016: 8th seed alliance captain at Greater Pittsburgh Regional and 6th seed alliance captain at the Buckeye Regional
Thanks to all our alliance members!
Reply With Quote
  #7   Spotlight this post!  
Unread 26-01-2017, 21:57
bobbysq bobbysq is offline
Registered User
FRC #4646 (Team ASAP)
Team Role: Leadership
 
Join Date: Apr 2016
Rookie Year: 2015
Location: Des Moines, IA
Posts: 337
bobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud of
Re: "Split Arcade" Drive with Xbox 360 Controller?

Quote:
Originally Posted by Xavbro View Post
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));
Or you could just use WPILib's own RobotDrive->ArcadeDrive function.
Reply With Quote
  #8   Spotlight this post!  
Unread 28-01-2017, 08:54
JoeyDaPanda's Avatar
JoeyDaPanda JoeyDaPanda is offline
Registered User
AKA: Joey
FRC #6324 (The Blue Devils)
Team Role: Programmer
 
Join Date: Nov 2016
Rookie Year: 2017
Location: Salem NH
Posts: 5
JoeyDaPanda is an unknown quantity at this point
Re: "Split Arcade" Drive with Xbox 360 Controller?

Quote:
Originally Posted by messer5740 View Post
Also, be mindful of the Xbox controller Axes. You can find them in the driver station USB panel.
Yup, been telling the other guys working on this with my that since day one that the axes we want are 1 and 4 but they dont listen haha
Reply With Quote
  #9   Spotlight this post!  
Unread 28-01-2017, 09:02
messer5740's Avatar
messer5740 messer5740 is offline
Registered User
FRC #5740 (Trojanators)
Team Role: Driver
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Pittsburgh
Posts: 142
messer5740 is an unknown quantity at this point
Re: "Split Arcade" Drive with Xbox 360 Controller?

Quote:
Originally Posted by JoeyDaPanda View Post
Yup, been telling the other guys working on this with my that since day one that the axes we want are 1 and 4 but they dont listen haha
We had the same issue of programming our linear strafing, and had a heck of a time too, but once we figured it out it was all good
__________________
A good driver is always better than a good robot.

2015: Winner of the Rookie Inspiration Award
2016: 8th seed alliance captain at Greater Pittsburgh Regional and 6th seed alliance captain at the Buckeye Regional
Thanks to all our alliance members!
Reply With Quote
  #10   Spotlight this post!  
Unread 28-01-2017, 09:37
Robo Hamsters Robo Hamsters is offline
Registered User
AKA: Matthew Vesperman
FRC #4466 (Robo Hamsters)
Team Role: Mentor
 
Join Date: Dec 2012
Rookie Year: 2012
Location: Culpeper, Va.
Posts: 91
Robo Hamsters is on a distinguished road
Re: "Split Arcade" Drive with Xbox 360 Controller?

The first thing we really need to know is what language are you guys using?
__________________

FRC 4466
FTC 7042
=================
2013 Washington DC Regional Finalist
Reply With Quote
  #11   Spotlight this post!  
Unread 28-01-2017, 09:44
JoeyDaPanda's Avatar
JoeyDaPanda JoeyDaPanda is offline
Registered User
AKA: Joey
FRC #6324 (The Blue Devils)
Team Role: Programmer
 
Join Date: Nov 2016
Rookie Year: 2017
Location: Salem NH
Posts: 5
JoeyDaPanda is an unknown quantity at this point
Re: "Split Arcade" Drive with Xbox 360 Controller?

Java definitely
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi