|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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
![]() |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
||||
|
||||
|
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 ![]() |
|
#4
|
||||
|
||||
|
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()); |
|
#5
|
||||
|
||||
|
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 |
|
#6
|
||||
|
||||
|
Re: switching the x & y on joy stick
sorry i read the code wrong i did not see you switch something else
|
|
#7
|
||||
|
||||
|
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() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Joy stick function description | Bruceb | Technical Discussion | 4 | 02-13-2009 02:40 PM |
| Acceleration limiter on the joy stick | Bruceb | Technical Discussion | 5 | 01-21-2009 06:53 PM |
| Joy stick variables. | Joshamuffin | Programming | 2 | 04-16-2008 05:49 PM |
| Joy stick | Sairamluap | Control System | 4 | 02-01-2008 04:04 PM |
| Joy Stick CAD | rcubes85 | Inventor | 0 | 01-26-2005 09:37 AM |