|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Joystick question
what is axis 3(throttle) on the logitech attack 3 joystick? Is the throttle the same as button 1, the trigger? I wouldn't think so. Is it the adjuster at the bottom with the positive and negative symbols?
Thanks |
|
#2
|
|||||
|
|||||
|
Re: Joystick question
Quote:
![]() |
|
#3
|
|||
|
|||
|
Re: Joystick question
Great. Now i have another question for you. Our robot this year was initially too fast, so we have a range and coerce function attached to both the x and y parts of our arcade drive in the code. It is currently set at i think .8 all around. Does axis 3 take away the need for this range and coerce function? Like if i had it all the way down, would it be set at 0, and if all the way towards the positive, 1? Would axis 3 pretty much act as a speed controller?
|
|
#4
|
||||
|
||||
|
Re: Joystick question
The throttle just adjusts the value returned by the vi, nothing else.
What our team did is multiplied the value of the joysticks by the throttle value, so we can have a slower speed. It's probably not a good idea to coerce the joystick value, because it's much more natural for the drivers to have a linear joystick to speed relationship, rather than a linear one and a flat part. Multiply by .8 (Or the throttle value!) instead. On many joysticks, keep in mind that the up position is negative (just like the Y axis). Also keep in mind that it goes from -1 to 1, not 0 to 1, so if you want to use it as a throttle, make sure you make it a value from 0 to 1 or your robot will run backwards half the time (which actually can be useful, but probably not for competition). |
|
#5
|
|||
|
|||
|
Re: Joystick question
Quote:
|
|
#6
|
||||
|
||||
|
Re: Joystick question
Take axis 1 and 2 (or just 2 if you're doing tank drive) and divide them by ((Axis 3 - 1)/2)
Basically make axis 3 from 0 to 1 and divide your other axes by it. If you're set on coercing it, you can do the same thing, then negate the value and put the negated value for the lower bound and the normal value for the upper bound. |
|
#7
|
|||||
|
|||||
|
Re: Joystick question
Quote:
Dividing by a factor ranging from 0-1 would scale up the joystick, making it faster. If you want to consider a more advanced scale function where you can move slowly for a select part of the joystick range then quickly ramp up to full speed read this white paper |
|
#8
|
|||
|
|||
|
Re: Joystick question
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|