|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Dual Joystick Code
My team is considering doing dual joysticks next year. I've been searching for anything on them, and I'm coming up dry. If anyone uses dual joysticks, and happens to have an old code, I'd really appreciate looking at it.
My coach wants me to get a headstart for next year and RoSi. ^_^ |
|
#2
|
||||
|
||||
|
Re: Dual Joystick Code
well, dual joystick is very simple, there is no fancy code.
You should have searched there are many examples. basically u need this in your user_routines.c pwm13=p1_y; pwm14=p2_y; //Where pwm13 is the motor controlling one side of the robot and pwm14 is controlling the other. |
|
#3
|
||||
|
||||
|
Re: Dual Joystick Code
Really? That simple? Makes sense. Thanks.
I did search a bit, prolly not in the right places. ^^; |
|
#4
|
|||||
|
|||||
|
Re: Dual Joystick Code
Direct mapping of joystick to motor is the easiest and most intuitive way to use two joysticks to control two motors. This year's TechnoKat robot does it the long way around, though, taking the average of the two sticks to control an internal "velocity" value, with the sticks' difference becoming a "turn" value. It essentially computes the equivalent of a single joystick. The output code remixes the velocity and turn values into two motor control numbers.
This complexity has its rewards. It makes navigating under autonomous control a wee bit simpler to implement, and it provides a straightforward way to implement speed-sensitive steering if desired. There are deadbands applied to the computed values, so it also theoretically makes driving straight at high speed slightly easier. |
|
#5
|
||||
|
||||
|
Re: Dual Joystick Code
Actually, if you take a look at the default code, dual driving joysticks are already in there. PWM01 is assigned the y value from Joystick 1 and PWM02 is assigned the y value from Joystick 2.
|
|
#6
|
|||
|
|||
|
Re: Dual Joystick Code
Quote:
|
|
#7
|
||||
|
||||
|
Re: Dual Joystick Code
I see. I'm not quite sure that we're using the second joystick for though, whether it's driving or operating our pneumatics. That part they neglected to tell me, would it matter?
|
|
#8
|
||||
|
||||
|
Re: Dual Joystick Code
Quote:
, because everyone on this thread was under impression that you wanted two joysticks for driving the robot, as opposed to a single joystick for driving. If you just need another joystick for an arm here is what you need.1. Make sure wether the arm is pneumatic, or motor. 2. If its motor, is it controlled by a victor or a spike. If the arm is pneumatic or motor on a spike then: relay1_fwd=p3_aux1; relay1_rev=p3_aux2; //here the single solenoid or the motor is on relay one. If arm is on a motor contorlled by a victor then: pwm03=p3_y; // All the code is assuming that the joystick used is on port3. |
|
#9
|
||||
|
||||
|
Re: Dual Joystick Code
Okay. ^^;; Sorry for the confusion. I didn't know what I was looking for, my team coach didn't specify what he wanted.
|
|
#10
|
|||
|
|||
|
Re: Dual Joystick Code
Quote:
I personally like how with 2 joystick drive, you know how the bot will turn (with a bit of practice). How does your modified two-joystick really offer any advantage over two-joystick (other than the easier straight values) As for the autonomous mode, you're not reading the pwms...so how does this make a difference in the end? (compared to using the standard one-joystick drive code) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need help w/ joystick code | willie837 | Programming | 6 | 02-02-2005 23:17 |
| Team THRUST - Kevin's Code and Camera Code Combine | Chris_Elston | Programming | 3 | 31-01-2005 22:28 |
| heres the code. y this not working | omega | Programming | 16 | 31-03-2004 15:18 |
| Changing 1 joystick code to 2 (rookie team) | Brawler006 | Programming | 5 | 20-02-2004 17:00 |
| robot goes haywire with the one joystick default code | Miles | Programming | 7 | 24-01-2003 14:58 |