![]() |
switching the x & y on joy stick
hello i been trying to get the holonomicDrive working right for some time now i just want to get the joy stick to switch its x & y input and i cant get in to the joystick source code and change it plz some one help me :confused:
|
Re: switching the x & y on joy stick
Can't you just reverse how you are implementing the axes in your code?
For example, if you are setting variable "velocity" to the y-axis, just set it to the x axis instead. Alternatively, you could create new variables such as "newX" and set the actual y-axis to newX. |
Re: switching the x & y on joy stick
ok i may be saying some thing wrong or i dont get what your saying (this is my first year mostly alone on getting this to work) ok i have this
m_robotDrive.holonomicDrive(m_rightStick.getMagnit ude(), m_rightStick.getDirectionDegrees(), m_leftStick.getX()); in the code and its the only places i have the joystick input i dont want to change the left stick at all i tried swiching m_rightStick.getMagnitude() and m_rightStick.getDirectionDegrees() but it goes hay wire and i did not change anything else. were using mecanum wheels and i have them on inputs of front 4 2 1 3 back some how it works but i just have the x and y mest up .. i might be giving random info and not making any scenes :confused: |
Re: switching the x & y on joy stick
I haven't looked at the default holonomic code this year, but from that code it looks as though the holonomic drive function is expecting you to use a 3-axis joystick.
m_rightStick.getMagnitude() would be the y-direction m_rightStick.getDirectionDegrees() would be the "twist" of the joystick m_leftStick.getX() would, of course, be the x direction. Are you using a 3-joystick set up? If not, then you will need to use a different holonomic drive method. If so, then all you should have to do is switch getMagnitute() and getX(). Thus the line would read- m_robotDrive.holonomicDrive(m_leftStick.getX(), m_rightStick.getDirectionDegrees(), m_rightStick.getMagnitude()); |
Re: switching the x & y on joy stick
no were using 2 logtech atk 3 joysticks witch you cant twist the joystick and changing
m_rightStick.getMagnitude() to m_rightStick.getX()just disable are y axis from the right joy stick |
Re: switching the x & y on joy stick
sorry i read the code wrong i did not see you switch something else
|
Re: switching the x & y on joy stick
Well since you do not have a 3-axis joystick you need to send something other than m_rightStick.getDirectionDegrees().
And wow, sorry, I just realized that you already have two different joysticks there. My bad! In any case, they still wont be able to give you a degree measurement. Is the second parameter just a float (does getDirectionDegrees() return an int from 0 to 360 or a float from -1 to 1)? If so, I would replace m_rightStick.getDirectionDegrees() with m_rightStick.getX() |
| All times are GMT -5. The time now is 09:02 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi