Is there a way to get a reading for desired rotation about the z-axis of the robot from a single-joystick setup? Is one able to twist the joystick or use the “wheel” on top of the joystick? And if it is the “wheel” we need to use, what is the range of input values we can get from there? I am really just looking for the name of the input (like in the code) and what the range of possible input values for it is.
Thanks in advance guys!
EDIT: One more question: Is there a better joystick or better solution to this? We want to program a mecanum drive and our algorithm needs a z-axis rotation input
ok, well, the default joystick doesn’t rotate, but the wheel does. i’ve never used it but, i know it’s an analog input. the easiest way to test it is to set up some printfs and just print out what it is at various postions.
We’re using the Saitek ST290 Pro with the USB Chicklet. It has X, Y, and Z (twist) axes, as well as a whole ton of buttons and even a throttle. It can be configured for lefties, too.
Thanks for the help guys. I’m pretty sure the “wheel” input on the KOP joystick is only an analog input because it has the 4 states of up, down, left, or right with no variation on the scale of 0-255. We have decided to use a second joystick’s X-axis as the Z-axis rotation input.
The ‘wheel’ input is in fact an analog 0-5v (0-255 increments) signal, just like the X&Y axis. It is typically the throttle in a flight sim. In FIRST it is almost never used on the joysticks. You can however use it, if you so choose, as a ‘hip’ or rudder axis.
On the old CH flight sticks it is the left most wheel and rotates something like 60 degrees. The other two wheels are trim. Some joysticks may use the ‘wheel’ as a 4 way ‘hat’ switch using a resistor network to get 4 distinct increments out of the analog. This is what I think you are referring to on your stick. The newer sticks they have been including in the kit probably use the hat switch in place of a real throttle wheel.
There is also a 4th analog on each joystick port that is also rarely used. The original design of the gameport intended for a y cable to be used to connect two joysticks to one computer. That never really happened, and the two other analogs usually were used for a throttle and hat switch. Then USB sticks came out and manufactures where no longer limited by the gameport and so you end up with a zillion buttons and axises.
There are many joysticks on the market that allow you to twist the stick about the z axis, usually to substitute for rudder pedals. They are probably all usb based however.