Go to Post Big Mike (i'm not big you are all just short ;) ) - Mike Schroeder [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 24-04-2011, 16:55
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Joystick Controller Help

Next month, our team is going to our middle school to show the students our robot and let them drive it around. Our current drive set up is with two joysticks. 1 with the arm and 1 for the arcade drive. We also have a logitech game controller laying around, and I might let the students drive with that so both joysticks are on the same controller. Also, most middle school kids play video games, so the feel should be easy. I have some questions with this though:

1) How do you program the two joysticks on the game controller separately to maintain one for the drive and one for the arm? I've only used a joystick so I am slightly lost.
2) On our drive joystick, we use axis 3 to control our speed. If the students are driving with the game controller, am i still able to control the speed even if I am not driving the robot on my joystick?
3) If the students are driving, and I quickly need to alter their driving, can I move my joystick to change direction, etc. or will the conflicting demands from both joysticks cause a problem with the jaguars?

We are using LabVIEW. Thanks for the help
Reply With Quote
  #2   Spotlight this post!  
Unread 24-04-2011, 17:27
bladetech932's Avatar
bladetech932 bladetech932 is offline
Programmer of awesome
AKA: Jon
FRC #0932 (Circuit Chargers)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Tulsa
Posts: 242
bladetech932 is on a distinguished road
Re: Joystick Controller Help

1) is simple. The controller is treated as 1 joystick with four axis
Ly=1 Lx=2 Ry=3 Rx=4 so use it in the same way you used other joysticks.
2) I am curious why you used axis 3 for speed instead of the normal y or x axis but the answer to your question is yes you can assign the speed to any axis even if its on a different controller
3) is a little harder but one thing you could do is if your joystick is out of a certain value, for example if the x or y value of your joystick is greater than the absolute value of .1 then, you have control if not then the student has control.

Hope that helps.
~Jon
__________________
Expect the best, Prepare for the worst
Reply With Quote
  #3   Spotlight this post!  
Unread 24-04-2011, 17:38
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Joystick Controller Help

Quote:
Originally Posted by bladetech932 View Post
1) is simple. The controller is treated as 1 joystick with four axis
Ly=1 Lx=2 Ry=3 Rx=4 so use it in the same way you used other joysticks.
2) I am curious why you used axis 3 for speed instead of the normal y or x axis but the answer to your question is yes you can assign the speed to any axis even if its on a different controller
3) is a little harder but one thing you could do is if your joystick is out of a certain value, for example if the x or y value of your joystick is greater than the absolute value of .1 then, you have control if not then the student has control.

Hope that helps.
~Jon
Thanks for the help. Answer to #1 makes sense now. For number 2, we initially had the speed at 80% normally, then 50% when the trigger was pushed. It did not really work so well on the practice day at our regional. Luckily, our programmer that graduated last year was there, and helped me make the speed adjustable with the dial on the bottom of the joystick. It made driving so much easier. With regards to question 3, I don't think it will be a big problem, because I probably won't put the speed too high anyway.

Lastly, is there anyway I could put a speed adjuster on the controller too?
Reply With Quote
  #4   Spotlight this post!  
Unread 24-04-2011, 17:51
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Joystick Controller Help

Would this be correct for what you said on question 1?
Attached Images
File Type: bmp check on delphi.bmp (64.6 KB, 37 views)
Reply With Quote
  #5   Spotlight this post!  
Unread 24-04-2011, 19:10
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Joystick Controller Help

Quote:
Originally Posted by jhellr13 View Post
Thanks for the help. Answer to #1 makes sense now. For number 2, we initially had the speed at 80% normally, then 50% when the trigger was pushed. It did not really work so well on the practice day at our regional. Luckily, our programmer that graduated last year was there, and helped me make the speed adjustable with the dial on the bottom of the joystick. It made driving so much easier. With regards to question 3, I don't think it will be a big problem, because I probably won't put the speed too high anyway.

Lastly, is there anyway I could put a speed adjuster on the controller too?
If there's a dial/button you want to use to adjust the speed, you can read it in LV. I don't think there's a throttle on a standard xbox controller, though.
Reply With Quote
  #6   Spotlight this post!  
Unread 24-04-2011, 20:03
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Joystick Controller Help

Quote:
Originally Posted by jhellr13 View Post
Thanks for the help. Answer to #1 makes sense now. For number 2, we initially had the speed at 80% normally, then 50% when the trigger was pushed. It did not really work so well on the practice day at our regional. Luckily, our programmer that graduated last year was there, and helped me make the speed adjustable with the dial on the bottom of the joystick. It made driving so much easier. With regards to question 3, I don't think it will be a big problem, because I probably won't put the speed too high anyway.

Lastly, is there anyway I could put a speed adjuster on the controller too?
If there's a dial/button you want to use to adjust the speed, you can read it in LV. I don't think there's a throttle on a standard xbox controller, though.
Reply With Quote
  #7   Spotlight this post!  
Unread 24-04-2011, 20:18
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Joystick Controller Help

Quote:
Originally Posted by WizenedEE View Post
If there's a dial/button you want to use to adjust the speed, you can read it in LV. I don't think there's a throttle on a standard xbox controller, though.

Yeah I don't think there is a throttle either. I'm just thinking out ideas though, so it isn't a problem. When we let the students drive, I will probably just give them the game controller, and I will control the robot through the 2 joysticks we initially use. Like said in an above post, I will control the speed through axis 4 on one of the joysticks like we did in our regional.
Above, the other person said that if I change the speed one my joystick, it should change the speed for every other joystick as well. is this correct?
Reply With Quote
  #8   Spotlight this post!  
Unread 25-04-2011, 00:08
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Joystick Controller Help

It really depends on how you program it -- if you multiply every axis of every joystick by the throttle value, they all get scaled down. If you only do it to one or two joysticks only those get scaled down.

You could also do something where the L button speeds it up (by something like 10%) and the R button slows it down. Or you could just have a constant multiplier of something like .4
Reply With Quote
  #9   Spotlight this post!  
Unread 26-04-2011, 16:57
DavidGitz's Avatar
DavidGitz DavidGitz is offline
Lead Technical Advisor
FRC #1208 (MeTool Brigade)
Team Role: Coach
 
Join Date: Dec 2006
Rookie Year: 1996
Location: O'Fallon, IL
Posts: 341
DavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud of
Send a message via AIM to DavidGitz Send a message via MSN to DavidGitz Send a message via Yahoo to DavidGitz
Re: Joystick Controller Help

Quote:
Originally Posted by jhellr13 View Post
3) If the students are driving, and I quickly need to alter their driving, can I move my joystick to change direction, etc. or will the conflicting demands from both joysticks cause a problem with the jaguars?

We are using LabVIEW. Thanks for the help
If you want to override the command from the game controller, you can program a button to override the game controller and make the joystick do whatever you want. If you don't want to override as much as compensate (i.e. still use the command that the game controller is giving) you can average the game controller command and the joystick command or something of that nature.
__________________
Reply With Quote
  #10   Spotlight this post!  
Unread 26-04-2011, 19:30
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Joystick Controller Help

Quote:
Originally Posted by DavidGitz View Post
If you want to override the command from the game controller, you can program a button to override the game controller and make the joystick do whatever you want. If you don't want to override as much as compensate (i.e. still use the command that the game controller is giving) you can average the game controller command and the joystick command or something of that nature.
I actually do want what you described. The ability to be able to say push the trigger, and have complete control, and over ride the game controller. How would I go about doing that though in LabVIEW?
Reply With Quote
  #11   Spotlight this post!  
Unread 27-04-2011, 12:40
SkyWarrior's Avatar
SkyWarrior SkyWarrior is offline
Crazy Mentor of 2948
AKA: Mr. Celik
FRC #2948 (Prototype)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Fort Worth, TX
Posts: 14
SkyWarrior is an unknown quantity at this point
Re: Joystick Controller Help

Properly designed case structures with Global Boolean variables should do the trick.
__________________
Ask me about Molecular Biology, i will tell you everything.
Ask me about robotics, i will tell you go to Chief Delphi.
Reply With Quote
  #12   Spotlight this post!  
Unread 27-04-2011, 16:26
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Joystick Controller Help

Quote:
Originally Posted by SkyWarrior View Post
Properly designed case structures with Global Boolean variables should do the trick.
I was gonna try it with case structures. I'll take a look at labview later
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 09:29.

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