Quote:
Originally Posted by touchdownjesus4
I was thinking about doing something like this, just have no idea how to program it. I'm programming in java and currently have it set up to do tank drive but wanted to try out this type of system. How does your team implement this?
|
You could use the following method
Code:
public void arcadeDrive(GenericHID moveStick, final int moveAxis, GenericHID rotateStick, final int rotateAxis, boolean squaredInputs)
Set moveStick and rotateStick to your controller and moveAxis to the y axis of the left stick and rotateAxis to the x axis of the right stick.
Quote:
Originally Posted by Ether
left_wheels = (ForwardCommand + ClockwiseRotationCommand)/2
right_wheels = (ForwardCommand - ClockwiseRotationCommand)/2
ForwardCommand and ClockwiseRotationCommand are -1 to +1.
|
The disadvantage of this algorithm is that when Forward Command is 1 and ClockwiseRotationCommand is 0, you only move at half speed.
I've attached a quick comparison between Ether's algorithm, the arcade drive in WPILib (Java and C++, not sure if it's different in LabVIEW), and the algorithm that we use. (We drive with tank drive in telop, but find that "arcade" is easier to program for in autonomous)