|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Programming an arcade drive for joysicks
I'm having a lot of trouble coming up with an algorithm on programming an arcade drive on a single joysick. We're using one joystick for our shooter, so our other one must drive the entire robot, here is what i know:
For both(joysticks): Y values: Up is -1 Down is 1 X values: Left is -1 Right is 1 i know there is something to do with triangles, but i'm not quite sure. Any help / links are really appreciated, thanks! |
|
#2
|
||||
|
||||
|
Re: Programming an arcade drive for joysicks
Quote:
You don't need to invent your own algorithm (unless you want to). The Java WPILib already has a ready-made Arcade Drive object. It's in the file "RobotDrive.java" |
|
#3
|
|||
|
|||
|
Re: Programming an arcade drive for joysicks
Thank you very much! do you know where i can find an example of this class in action? i seems a bit confusing to me, i'm not sure where to place the robotDrive code(in a move function or when initialized?).
|
|
#4
|
||||
|
||||
|
Re: Programming an arcade drive for joysicks
Quote:
|
|
#5
|
|||
|
|||
|
Re: Programming an arcade drive for joysicks
It includes a sample project on how to pick up reflective tape and aim, but nothing on the arcadeDrive object
EDIT: got it working! thanks for the help, though i came across another problem when i got the arcade drive working.... I had to remove my calls to the jaguars to initialize the arcade drive object, so i need to also modify my shoot function. it WAS like this: Code:
if(gShoot.getAngle < finalAngle) {
//slowly turns motors until angle is reached
jag1.set(.15);
jag2.set(.15);
jag3.set(.15);
jag4.set(.15);
}
//function goes on... Last edited by Gmercer : 02-02-2013 at 16:12. |
|
#6
|
||||
|
||||
|
Re: Programming an arcade drive for joysicks
Quote:
arcadeDrive(0,0.15) though 0.15 is hardly ANYTHING, i cant get my robot to move (due to jaguars not putting enough force) without a 0.25 move |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|