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
- Configure the motors as
leftFront,leftBack,rightBack, andrightFront - Configure the IMU as
imu - 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; - In
TuningOpModes.java, setDRIVE_CLASS:
public static final Class<?> DRIVE_CLASS = MecanumDrive.class; - In line 242 of
MecanumDrive.java, set localizer:
localizer = new ThreeDeadWheelLocalizer(hardwareMap, PARAMS.inPerTick); - 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.
- Change the configuration for the motor names in
ThreeDeadWheelLocalizer.javato 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"))); - Configure the parallel encoders to be named
par0andpar1, and the perpendicular encoder to be namedperp