Search in sources :

Example 1 with PIDFController

use of frc.robot.PIDFController in project RapidReact2022 by team223.

the class AutoDrive1 method initialize.

// Called when the command is initially scheduled.
@Override
public void initialize() {
    drivePid = new PIDFController(.3, 0.02, 0, 0.03);
    try {
        Path trajectoryPath = Filesystem.getDeployDirectory().toPath().resolve(trajectoryJSON);
        trajectory = TrajectoryUtil.fromPathweaverJson(trajectoryPath);
    } catch (IOException ex) {
        System.out.println("Unable to open trajectory: " + trajectoryJSON);
    }
    kinematics = new DifferentialDriveKinematics(Units.inchesToMeters(23.5));
    startTimeMillis = System.currentTimeMillis();
    System.out.println("start!");
}
Also used : Path(java.nio.file.Path) PIDFController(frc.robot.PIDFController) DifferentialDriveKinematics(edu.wpi.first.math.kinematics.DifferentialDriveKinematics) IOException(java.io.IOException)

Aggregations

DifferentialDriveKinematics (edu.wpi.first.math.kinematics.DifferentialDriveKinematics)1 PIDFController (frc.robot.PIDFController)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1