Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Joystick Controller Help (http://www.chiefdelphi.com/forums/showthread.php?t=94790)

jhellr13 24-04-2011 16:55

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

bladetech932 24-04-2011 17:27

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

jhellr13 24-04-2011 17:38

Re: Joystick Controller Help
 
Quote:

Originally Posted by bladetech932 (Post 1056126)
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?

jhellr13 24-04-2011 17:51

Re: Joystick Controller Help
 
1 Attachment(s)
Would this be correct for what you said on question 1?

WizenedEE 24-04-2011 19:10

Re: Joystick Controller Help
 
Quote:

Originally Posted by jhellr13 (Post 1056128)
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.

WizenedEE 24-04-2011 20:03

Re: Joystick Controller Help
 
Quote:

Originally Posted by jhellr13 (Post 1056128)
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.

jhellr13 24-04-2011 20:18

Re: Joystick Controller Help
 
Quote:

Originally Posted by WizenedEE (Post 1056168)
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?

WizenedEE 25-04-2011 00:08

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

DavidGitz 26-04-2011 16:57

Re: Joystick Controller Help
 
Quote:

Originally Posted by jhellr13 (Post 1056117)
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.

jhellr13 26-04-2011 19:30

Re: Joystick Controller Help
 
Quote:

Originally Posted by DavidGitz (Post 1056787)
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?

SkyWarrior 27-04-2011 12:40

Re: Joystick Controller Help
 
Properly designed case structures with Global Boolean variables should do the trick.

jhellr13 27-04-2011 16:26

Re: Joystick Controller Help
 
Quote:

Originally Posted by SkyWarrior (Post 1057071)
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


All times are GMT -5. The time now is 09:29.

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