Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Problem with Joystick axis problem (http://www.chiefdelphi.com/forums/showthread.php?t=152022)

kingca 24-10-2016 11:08

Problem with Joystick axis problem
 
Our team is using c++ and we been having a problem with the joystick axis. The problem occurs when we plug in the joystick into the USB port and it is not configured properly sometimes making the robot start moving by itself. Has any others teams had this problem and how have you solved the problem?

nickbrickmaster 24-10-2016 11:12

Re: Problem with Joystick axis problem
 
It's a common problem, especially on video game consoles. The solution is to make sure that the joystick is at center when it is plugged in. The reason is that the joystick takes the value when plugged in to be the zero value.

If that doesn't work, introduce a small deadband in your code, 0.05 abouts.

jimbo493 24-10-2016 11:13

Re: Problem with Joystick axis problem
 
Is it just moving a little bit, slowly? If so I would assume that you may want to put a dead zone around the center of the axis, since a lot of joysticks dont always fall back to dead center. I assume if you move the axis and let go it stops the movement?

Christopher149 24-10-2016 11:41

Re: Problem with Joystick axis problem
 
How many axes does your joystick have?

We have a 3-axis joystick where (at least in 2013 using Java, don't know if any software fix happened later) the x- and y-axis made perfect sense, but the "twist" axis was actually called "throttle" in the code, and "z" and "twist" were both the little paddle-like axis on the base of the stick.

So when we first went to run our mecanum (thankfully it was on blocks), we had no idea why it was running so fast and seemingly randomly, but it was because the little paddle wasn't at 0 (which is around 45 degrees), but all the way down at 1/-1.

orangelight 24-10-2016 19:07

Re: Problem with Joystick axis problem
 
I ran into this problem when debugging another teams code, I believe they were using a Logitech joystick. The problem was as nickbrickmaster said, the joystick was not centered. We just re-plugged in the joystick and it worked as usual.


All times are GMT -5. The time now is 12:30.

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