Constants
The Constants file
You may have noticed that there is a Constants
file in the pedroPathing
package. This is where you configure all your constants for Pedro. It
contains four types of constants:
- Follower constants consist of values from the automatic, PID, and centripetal tuners.
- Drivetrain constants contain constants specific to your drivetrain type. For example, mecanum drivetrain constants contain the motor names.
- Localizer constants contain constants specific to your localizer. For example, OTOS constants include the hardware map name of the OTOS and the offset.
- Path constraints determine under what conditions a path may end.
There is also a createFollower
method that constructs the follower. You
will call this method in your OpModes.
Below is a starting Constants
file. The different tuning pages will guide
you through modifying it to suit your robot.
public class Constants {
public static FollowerConstants followerConstants = new FollowerConstants();
public static PathConstraints pathConstraints = new PathConstraints(0.99, 100, 3, 1);
public static Follower createFollower(HardwareMap hardwareMap) {
return new FollowerBuilder(followerConstants, hardwareMap)
.pathConstraints(pathConstraints)
.build();
}
}
Last updated on