Go to Post Yellow bananas are the new red herrings. - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-21-2010, 12:36 PM
/*P4bl0*/'s Avatar
/*P4bl0*/ /*P4bl0*/ is offline
Registered User
FRC #0231
 
Join Date: Apr 2008
Location: Pasadena Tx.
Posts: 12
/*P4bl0*/ can only hope to improve
Question 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
Reply With Quote
  #2   Spotlight this post!  
Unread 02-21-2010, 12:50 PM
Bryan Herbst's Avatar
Bryan Herbst Bryan Herbst is offline
Registered User
AKA: Bryan
FRC #2052 (KnightKrawler)
Team Role: Mentor
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Minneapolis, Minnesota
Posts: 544
Bryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond repute
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.
__________________
Team 2052- Knightkrawler
Mentor and volunteer
Reply With Quote
  #3   Spotlight this post!  
Unread 02-21-2010, 01:18 PM
/*P4bl0*/'s Avatar
/*P4bl0*/ /*P4bl0*/ is offline
Registered User
FRC #0231
 
Join Date: Apr 2008
Location: Pasadena Tx.
Posts: 12
/*P4bl0*/ can only hope to improve
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
Reply With Quote
  #4   Spotlight this post!  
Unread 02-21-2010, 01:45 PM
Bryan Herbst's Avatar
Bryan Herbst Bryan Herbst is offline
Registered User
AKA: Bryan
FRC #2052 (KnightKrawler)
Team Role: Mentor
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Minneapolis, Minnesota
Posts: 544
Bryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond repute
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());
__________________
Team 2052- Knightkrawler
Mentor and volunteer
Reply With Quote
  #5   Spotlight this post!  
Unread 02-21-2010, 01:58 PM
/*P4bl0*/'s Avatar
/*P4bl0*/ /*P4bl0*/ is offline
Registered User
FRC #0231
 
Join Date: Apr 2008
Location: Pasadena Tx.
Posts: 12
/*P4bl0*/ can only hope to improve
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
Reply With Quote
  #6   Spotlight this post!  
Unread 02-21-2010, 01:59 PM
/*P4bl0*/'s Avatar
/*P4bl0*/ /*P4bl0*/ is offline
Registered User
FRC #0231
 
Join Date: Apr 2008
Location: Pasadena Tx.
Posts: 12
/*P4bl0*/ can only hope to improve
Re: switching the x & y on joy stick

sorry i read the code wrong i did not see you switch something else
Reply With Quote
  #7   Spotlight this post!  
Unread 02-21-2010, 02:20 PM
Bryan Herbst's Avatar
Bryan Herbst Bryan Herbst is offline
Registered User
AKA: Bryan
FRC #2052 (KnightKrawler)
Team Role: Mentor
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Minneapolis, Minnesota
Posts: 544
Bryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond repute
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()
__________________
Team 2052- Knightkrawler
Mentor and volunteer
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 09:04 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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