|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Single Joystick Tank Drive
Use the arcade drive method in Joystick. It will do EXACTLY what you want it to do.
|
|
#2
|
|||
|
|||
|
Re: Single Joystick Tank Drive
Thanks for the responses!
I got it working with Code:
m_robotDrive.arcadeDrive(m_driveStick.getY(), m_driveStick.getX()); Right now it goes forward, back, turns on the spot and strafes forward perfectly. But if trying to pull the joystick back-left, the left motor is working 100% backwards, which essentially moves the robot's back to the right. If pulling back-right, the right motor is working 100% backwards, which moves the robot back to the left. Intuitively when trying to do that, you'd expect it to work like a car would, turning left would make the back go left.. I would like to change that so drivers could have it more intuitively. I will post when/if I figure it out. Again, thanks everyone for taking the time. J |
|
#3
|
||||
|
||||
|
Re: Single Joystick Tank Drive
Quote:
|
|
#4
|
|||
|
|||
|
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);
Ether, it looks like your solution Quote:
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. |
|
#5
|
||||
|
||||
|
Re: Single Joystick Tank Drive
Quote:
|
|
#6
|
|||
|
|||
|
Re: Single Joystick Tank Drive
Yup
|
|
#7
|
||||
|
||||
|
Re: Single Joystick Tank Drive
Try a different joystick.
|
|
#8
|
||||
|
||||
|
Re: Single Joystick Tank Drive
I believe you can also go into the windows control panel, find the Game Controllers adapter and use it to center the joystick (ie, the joystick reads 0,0 when centered).
|
|
#9
|
|||
|
|||
|
Re: Single Joystick Tank Drive
It does say 0.0 at the beginning, but after driving it for a bit then letting go, it doesn't always center perfectly.
Both of our joysticks do that :\ |
|
#10
|
||||
|
||||
|
Re: Single Joystick Tank Drive
Quote:
|
|
#11
|
|||
|
|||
|
Re: Single Joystick Tank Drive
They're clean outta the box ones... :'(
|
|
#12
|
||||
|
||||
|
Re: Single Joystick Tank Drive
Maybe there's an error in your software?
Try loading the default code that came with the LabVIEW installation and run it and see if it does the same thing. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|