Holonomic Drive Program

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));

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.

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.

Could you give me a link to that?


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

Its actually
drive.MecanumDrive_Polar(leftStick.getDirectionDegrees (), leftStick.getMagnitude(), joystick.getTwist());

thanks for all the advice, 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?