Go to Post BTW - using any Lavery clue to figure anything out could be equally impossible. - Raul [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-04-2005, 19:05
1086Programmer's Avatar
1086Programmer 1086Programmer is offline
'Spirit Leader'
AKA: Sara Bailey
FRC #1086 (Blue Cheese)
Team Role: Marketing
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Richmond, Va
Posts: 37
1086Programmer will become famous soon enough1086Programmer will become famous soon enough
Send a message via AIM to 1086Programmer
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. ^_^
__________________
"Chad, duck tape's supposed to fix everything, right? What about programming errors?"
[font=Verdana]"You know, I love how we can just grunt, hum, and mumble, and still understand each other." Brian [FONT]
"I'm not making the phone call, you make the phone call!"
2005 † VCU Regionals Team Spirit Award
  #2   Spotlight this post!  
Unread 09-04-2005, 19:10
thoughtful's Avatar
thoughtful thoughtful is offline
Registered User
FRC #1219 (Emery Iron Eagle)
Team Role: Alumni
 
Join Date: Nov 2003
Location: Toronto,Canada
Posts: 291
thoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to behold
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.
__________________
.:Bringling Brains to Life:.

03,04,05-Team 1219 Captain
2003 Rookie all Start @ GTR
2005 Galileo Semi-Finalist & Alliance captain
06-Team 1219 Mentor
2006 Radio Shack Innovation in control @ Waterloo
  #3   Spotlight this post!  
Unread 09-04-2005, 19:23
1086Programmer's Avatar
1086Programmer 1086Programmer is offline
'Spirit Leader'
AKA: Sara Bailey
FRC #1086 (Blue Cheese)
Team Role: Marketing
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Richmond, Va
Posts: 37
1086Programmer will become famous soon enough1086Programmer will become famous soon enough
Send a message via AIM to 1086Programmer
Re: Dual Joystick Code

Really? That simple? Makes sense. Thanks.

I did search a bit, prolly not in the right places. ^^;
__________________
"Chad, duck tape's supposed to fix everything, right? What about programming errors?"
[font=Verdana]"You know, I love how we can just grunt, hum, and mumble, and still understand each other." Brian [FONT]
"I'm not making the phone call, you make the phone call!"
2005 † VCU Regionals Team Spirit Award
  #4   Spotlight this post!  
Unread 10-04-2005, 09:42
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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   Spotlight this post!  
Unread 10-04-2005, 13:26
jdhawg's Avatar
jdhawg jdhawg is offline
Programmer/Mentor/Parent. Pick One
AKA: Jack D Higgs
FRC #0364 (Team Fusion)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Gulfport, MS
Posts: 49
jdhawg will become famous soon enough
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.
__________________
"Opportunity is missed by most people because it is dressed in overalls and looks like work." - Thomas A. Edison

"In the professional world, spelling mistakes, grammatical shortcuts, leet-speek, and misused verbiage are not interpreted as signs of cute, efficient communications. They are indicators of illiteracy, inefficiency, unprofessional behavior, and sloppy work habits." - Dave Lavery
  #6   Spotlight this post!  
Unread 10-04-2005, 13:37
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Dual Joystick Code

Quote:
Originally Posted by Alan Anderson
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.
Would you share this code with us?
  #7   Spotlight this post!  
Unread 10-04-2005, 13:56
1086Programmer's Avatar
1086Programmer 1086Programmer is offline
'Spirit Leader'
AKA: Sara Bailey
FRC #1086 (Blue Cheese)
Team Role: Marketing
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Richmond, Va
Posts: 37
1086Programmer will become famous soon enough1086Programmer will become famous soon enough
Send a message via AIM to 1086Programmer
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?
__________________
"Chad, duck tape's supposed to fix everything, right? What about programming errors?"
[font=Verdana]"You know, I love how we can just grunt, hum, and mumble, and still understand each other." Brian [FONT]
"I'm not making the phone call, you make the phone call!"
2005 † VCU Regionals Team Spirit Award
  #8   Spotlight this post!  
Unread 10-04-2005, 14:33
thoughtful's Avatar
thoughtful thoughtful is offline
Registered User
FRC #1219 (Emery Iron Eagle)
Team Role: Alumni
 
Join Date: Nov 2003
Location: Toronto,Canada
Posts: 291
thoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to beholdthoughtful is a splendid one to behold
Re: Dual Joystick Code

Quote:
Originally Posted by 1086Programmer
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?
It will , 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.
__________________
.:Bringling Brains to Life:.

03,04,05-Team 1219 Captain
2003 Rookie all Start @ GTR
2005 Galileo Semi-Finalist & Alliance captain
06-Team 1219 Mentor
2006 Radio Shack Innovation in control @ Waterloo
  #9   Spotlight this post!  
Unread 10-04-2005, 16:31
1086Programmer's Avatar
1086Programmer 1086Programmer is offline
'Spirit Leader'
AKA: Sara Bailey
FRC #1086 (Blue Cheese)
Team Role: Marketing
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Richmond, Va
Posts: 37
1086Programmer will become famous soon enough1086Programmer will become famous soon enough
Send a message via AIM to 1086Programmer
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.
__________________
"Chad, duck tape's supposed to fix everything, right? What about programming errors?"
[font=Verdana]"You know, I love how we can just grunt, hum, and mumble, and still understand each other." Brian [FONT]
"I'm not making the phone call, you make the phone call!"
2005 † VCU Regionals Team Spirit Award
  #10   Spotlight this post!  
Unread 10-04-2005, 21:22
Goldeye Goldeye is offline
Registered User
AKA: Josh Hecht
FRC #0694 (Stuypulse)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: New York
Posts: 145
Goldeye has a spectacular aura aboutGoldeye has a spectacular aura aboutGoldeye has a spectacular aura about
Send a message via AIM to Goldeye
Re: Dual Joystick Code

Quote:
Originally Posted by Alan Anderson
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.
Why not just use one joystick at that point?
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)
__________________
Team 694

2005 Championship - Galileo Semifinalist
2005 New York - Regional Chairmans Award
2005 New York - Semifinalist (Thanks 1257,1340)
Closed Thread


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

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


All times are GMT -5. The time now is 00:16.

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