Search in sources :

Example 6 with Trajectory

use of edu.wpi.first.math.trajectory.Trajectory in project Entropy2022 by Team138Entropy.

the class TrajectoryLibrary method get_Tarmac1_B2_trajectory.

public Trajectory get_Tarmac1_B2_trajectory() {
    Trajectory traj = null;
    String fileName = "Tarmac1_B2.wpilib.json";
    try {
        Path trajectoryPath = getTrajectoryPath(fileName);
        traj = TrajectoryUtil.fromPathweaverJson(trajectoryPath);
    } catch (IOException ex) {
        System.out.println("Unable to open trajectory: " + fileName);
    }
    return traj;
}
Also used : Path(java.nio.file.Path) Trajectory(edu.wpi.first.math.trajectory.Trajectory) IOException(java.io.IOException)

Example 7 with Trajectory

use of edu.wpi.first.math.trajectory.Trajectory in project Entropy2022 by Team138Entropy.

the class TrajectoryLibrary method get_New_B3_B2.

public Trajectory get_New_B3_B2() {
    Trajectory traj = null;
    String fileName = "New-B3_B2.wpilib.json";
    try {
        Path trajectoryPath = getTrajectoryPath(fileName);
        traj = TrajectoryUtil.fromPathweaverJson(trajectoryPath);
    } catch (IOException ex) {
        System.out.println("Unable to open trajectory: " + fileName);
    }
    return traj;
}
Also used : Path(java.nio.file.Path) Trajectory(edu.wpi.first.math.trajectory.Trajectory) IOException(java.io.IOException)

Example 8 with Trajectory

use of edu.wpi.first.math.trajectory.Trajectory in project Entropy2022 by Team138Entropy.

the class TrajectoryLibrary method get_New_B3_T2.

public Trajectory get_New_B3_T2() {
    Trajectory traj = null;
    String fileName = "B3_T2.wpilib.json";
    try {
        Path trajectoryPath = getTrajectoryPath(fileName);
        traj = TrajectoryUtil.fromPathweaverJson(trajectoryPath);
    } catch (IOException ex) {
        System.out.println("Unable to open trajectory: " + fileName);
    }
    return traj;
}
Also used : Path(java.nio.file.Path) Trajectory(edu.wpi.first.math.trajectory.Trajectory) IOException(java.io.IOException)

Example 9 with Trajectory

use of edu.wpi.first.math.trajectory.Trajectory in project Entropy2022 by Team138Entropy.

the class TrajectoryLibrary method getBasicTrajectory.

public Trajectory getBasicTrajectory() {
    Trajectory traj = null;
    String fileName = "hardbolt2.wpilib.json";
    try {
        Path trajectoryPath = getTrajectoryPath(fileName);
        traj = TrajectoryUtil.fromPathweaverJson(trajectoryPath);
    } catch (IOException ex) {
        System.out.println("Unable to open trajectory: " + fileName);
    }
    return traj;
}
Also used : Path(java.nio.file.Path) Trajectory(edu.wpi.first.math.trajectory.Trajectory) IOException(java.io.IOException)

Example 10 with Trajectory

use of edu.wpi.first.math.trajectory.Trajectory in project Entropy2022 by Team138Entropy.

the class TrajectoryLibrary method get_B2_setup_B3.

public Trajectory get_B2_setup_B3() {
    Trajectory traj = null;
    String fileName = "B2_setup_B3.wpilib.json";
    try {
        Path trajectoryPath = getTrajectoryPath(fileName);
        traj = TrajectoryUtil.fromPathweaverJson(trajectoryPath);
    } catch (IOException ex) {
        System.out.println("Unable to open trajectory: " + fileName);
    }
    return traj;
}
Also used : Path(java.nio.file.Path) Trajectory(edu.wpi.first.math.trajectory.Trajectory) IOException(java.io.IOException)

Aggregations

Trajectory (edu.wpi.first.math.trajectory.Trajectory)48 IOException (java.io.IOException)24 Path (java.nio.file.Path)24 Pose2dFeet (team.gif.lib.Pose2dFeet)19 RobotTrajectory (team.gif.lib.RobotTrajectory)19 PIDController (edu.wpi.first.math.controller.PIDController)5 Pose2d (edu.wpi.first.math.geometry.Pose2d)5 TrajectoryConfig (edu.wpi.first.math.trajectory.TrajectoryConfig)5 ProfiledPIDController (edu.wpi.first.math.controller.ProfiledPIDController)3 Rotation2d (edu.wpi.first.math.geometry.Rotation2d)3 Translation2d (edu.wpi.first.math.geometry.Translation2d)3 RamseteController (edu.wpi.first.math.controller.RamseteController)2 SimpleMotorFeedforward (edu.wpi.first.math.controller.SimpleMotorFeedforward)2 RamseteCommand (edu.wpi.first.wpilibj2.command.RamseteCommand)2 DifferentialDriveKinematics (edu.wpi.first.math.kinematics.DifferentialDriveKinematics)1 DifferentialDriveVoltageConstraint (edu.wpi.first.math.trajectory.constraint.DifferentialDriveVoltageConstraint)1 Waypoint (edu.wpi.first.pathweaver.Waypoint)1 MecanumControllerCommand (edu.wpi.first.wpilibj2.command.MecanumControllerCommand)1 SwerveControllerCommand (edu.wpi.first.wpilibj2.command.SwerveControllerCommand)1 File (java.io.File)1