~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~

Roadrunner

Official documentation can be found at https://rr.brott.dev/docs/.

Tuning

The following directions are for Mecanum drives, with three dead wheels:

Drive Classes

  1. Configure the motors as leftFront, leftBack, rightBack, and rightFront
  2. Configure the IMU as imu
  3. Set the logo and USB direction of the IMU in the class code according to examples here. For example:
public RevHubOrientationOnRobot.LogoFacingDirection logoFacingDirection =
    RevHubOrientationOnRobot.LogoFacingDirection.LEFT;
public RevHubOrientationOnRobot.UsbFacingDirection usbFacingDirection =
    RevHubOrientationOnRobot.UsbFacingDirection.UP;
  1. In TuningOpModes.java, set DRIVE_CLASS:
public static final Class<?> DRIVE_CLASS = MecanumDrive.class;
  1. In line 242 of MecanumDrive.java, set localizer:
localizer = new ThreeDeadWheelLocalizer(hardwareMap, PARAMS.inPerTick);
  1. Plug the encoder wires into the ports corresponding to the correct motors. Note that for technical reasons, ports 0 and 3 and the REV hub are faster, and so should be used for the parallel encoders.
  2. Change the configuration for the motor names in ThreeDeadWheelLocalizer.java to match the corresponding motors that the encoders were plugged into:
par0 = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "leftFront")));
par1 = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "rightBack")));
perp = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "leftBack")));
  1. Configure the parallel encoders to be named par0 and par1, and the perpendicular encoder to be named perp
NORMAL
1:1