Go to Post However, it is logistically impossible, so it's now just a joke. - EricH [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

 
 
 
Thread Tools Rating: Thread Rating: 3 votes, 4.67 average. Display Modes
Prev Previous Post   Next Post Next
  #11   Spotlight this post!  
Unread 02-02-2011, 12:18 AM
Shantali Shantali is offline
Registered User
FRC #3609
 
Join Date: Jan 2011
Location: Maine, US
Posts: 9
Shantali is an unknown quantity at this point
Re: Single Joystick Tank Drive

I was trying to work around that using
Code:
double m_y = m_driveStick.getY();
double m_x = m_driveStick.getX();
if (m_y >= 0) //the Y axis is inverted, so going forward is negative number
    m_x = 0-m_x; //inverting X value
m_robotDrive.arcadeDrive(m_y, m_x);
The problem I faced with that was that the joystick wasn't giving me a perfect 0.. I added a simple println statement to get the y values, and it ranged anywhere from -0.3 to 0.3...

Ether, it looks like your solution
Quote:
if(Yj<=0){L=-Yj+Xj; R=-Yj-Xj;}
would have the same problem.

I tried something like if m_y >= -0.3, but it results in motors rapidly switching directions if starting slowly..

Another possible solution would be treating anything within .2 or so from the axis as 0.. but it doesn't seem like the best way of doing it either.

Thanks in advance,
j.
Reply With Quote
 


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


All times are GMT -5. The time now is 08:50 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