Log in

View Full Version : Holonomic Drive Program


cheezburger
19-01-2011, 15:28
My team is switching to Java this year and we want a holonomic drive system.

Not quite sure how to program it. When we tried to use the holonomicDrive method, Netbeans gave us a slew of errors, the most common of which was that

"holonomicDrive(float, float, float) is not public in edu.wpi.first.wpilibj.RobotDrive; cannot be accesed from outside package."

This is the code we have:

public void operatorControl() {
while (true && isOperatorControl() && isEnabled()) // loop until change
{
drive.holonomicDrive(leftStick.getDirectionDegrees (), leftStick.getMagnitude(), rightStick.getX(GenericHID.Hand.kRight));
Timer.delay(0.005);
}
}

I'm open to help in fixing holonomicDrive or to help in making a holonomic from scratch, as long as it works. The place I got the current code from said it was not tested code. I'd like code that has been known to work.

Jared Russell
19-01-2011, 15:38
I don't see RobotDrive.holonomicDrive in the 2011 JavaDoc. You could use one of the mecanumDrive methods, however - the code for open-loop control of a holonomic drive with 4 wheels on 45 degree angles is identical to the code you'd use for a mecanum setup.

cheezburger
19-01-2011, 15:44
Could you give me a link to that?

Jared Russell
19-01-2011, 16:13
http://www.wbrobotics.com/javadoc/index.html?overview-summary.html

Look in edu.wpi.first.wpilibj.RobotDrive for the "mecanumDrive_XXX" methods.

kinganu123
19-01-2011, 16:44
Its actually
drive.MecanumDrive_Polar(leftStick.getDirectionDeg rees (), leftStick.getMagnitude(), joystick.getTwist());

cheezburger
14-02-2011, 07:24
thanks for all the advice, we ended up making our own drive without the provided methods

everything is working now.

Ether
14-02-2011, 08:49
we ended up making our own drive without the provided methods

everything is working now.

I'd be curious to see what you came up with. Are you open to sharing it?