Search in sources :

Example 1 with Pose2dFeet

use of team.gif.lib.Pose2dFeet in project FRC2022 by Team2338.

the class FiveBallTerminalRight method pickupTerminal.

public Command pickupTerminal() {
    Trajectory trajectory = TrajectoryGenerator.generateTrajectory(List.of(new Pose2dFeet().set(-1.5, 13.0, 55.0), // 3rd cargo (terminal) location
    new Pose2dFeet().set(-5.5, 21.0, 43.0)), RobotTrajectory.getInstance().configReverseFast);
    // create the command using the trajectory
    RamseteCommand rc = RobotTrajectory.getInstance().createRamseteCommand(trajectory);
    // Run path following command, then stop at the end.
    return rc.andThen(() -> Robot.drivetrain.tankDriveVolts(0, 0));
}
Also used : Pose2dFeet(team.gif.lib.Pose2dFeet) Trajectory(edu.wpi.first.math.trajectory.Trajectory) RobotTrajectory(team.gif.lib.RobotTrajectory)

Example 2 with Pose2dFeet

use of team.gif.lib.Pose2dFeet in project FRC2022 by Team2338.

the class FiveBallTerminalRight method reverse.

public Command reverse() {
    Trajectory trajectory = TrajectoryGenerator.generateTrajectory(List.of(new Pose2dFeet().set(0.0, 0.0, 0.0), // 1st cargo location
    new Pose2dFeet().set(-3.4, 0.0, 0.0)), RobotTrajectory.getInstance().configReverseSlow);
    // create the command using the trajectory
    RamseteCommand rc = RobotTrajectory.getInstance().createRamseteCommand(trajectory);
    // Run path following command, then stop at the end.
    return rc.andThen(() -> Robot.drivetrain.tankDriveVolts(0, 0));
}
Also used : Pose2dFeet(team.gif.lib.Pose2dFeet) Trajectory(edu.wpi.first.math.trajectory.Trajectory) RobotTrajectory(team.gif.lib.RobotTrajectory)

Example 3 with Pose2dFeet

use of team.gif.lib.Pose2dFeet in project FRC2022 by Team2338.

the class FiveBallTerminalRight method forward.

public Command forward() {
    Trajectory trajectory = TrajectoryGenerator.generateTrajectory(List.of(new Pose2dFeet().set(-5.5, 21.0, 43.0), // shooting location
    new Pose2dFeet().set(0.0, 13.0, 55.0)), RobotTrajectory.getInstance().configForwardFast);
    // create the command using the trajectory
    RamseteCommand rc = RobotTrajectory.getInstance().createRamseteCommand(trajectory);
    // Run path following command, then stop at the end.
    return rc.andThen(() -> Robot.drivetrain.tankDriveVolts(0, 0));
}
Also used : Pose2dFeet(team.gif.lib.Pose2dFeet) Trajectory(edu.wpi.first.math.trajectory.Trajectory) RobotTrajectory(team.gif.lib.RobotTrajectory)

Example 4 with Pose2dFeet

use of team.gif.lib.Pose2dFeet in project FRC2022 by Team2338.

the class FourBallTerminalRight method forward.

public Command forward() {
    Trajectory trajectory = TrajectoryGenerator.generateTrajectory(List.of(new Pose2dFeet().set(-5.5, 20.5, 54.0), // shooting location
    new Pose2dFeet().set(0.0, 11.0, 50.0)), RobotTrajectory.getInstance().configForwardFast);
    // create the command using the trajectory
    RamseteCommand rc = RobotTrajectory.getInstance().createRamseteCommand(trajectory);
    // Run path following command, then stop at the end.
    return rc.andThen(() -> Robot.drivetrain.tankDriveVolts(0, 0));
}
Also used : Pose2dFeet(team.gif.lib.Pose2dFeet) Trajectory(edu.wpi.first.math.trajectory.Trajectory) RobotTrajectory(team.gif.lib.RobotTrajectory)

Example 5 with Pose2dFeet

use of team.gif.lib.Pose2dFeet in project FRC2022 by Team2338.

the class FourBallTerminalRight method pickUpNext2.

public Command pickUpNext2() {
    Trajectory trajectory = TrajectoryGenerator.generateTrajectory(List.of(new Pose2dFeet().set(-3.4, 0.0, 0.0), // ~turn in place
    new Pose2dFeet().set(-3.4, 2.0, 95.0), // 2nd cargo location
    new Pose2dFeet().set(-1.5, 8.0, 95.0), // 3rd cargo (terminal) location
    new Pose2dFeet().set(-5.5, 20.5, 54.0)), RobotTrajectory.getInstance().configReverse);
    // create the command using the trajectory
    RamseteCommand rc = RobotTrajectory.getInstance().createRamseteCommand(trajectory);
    // Run path following command, then stop at the end.
    return rc.andThen(() -> Robot.drivetrain.tankDriveVolts(0, 0));
}
Also used : Pose2dFeet(team.gif.lib.Pose2dFeet) Trajectory(edu.wpi.first.math.trajectory.Trajectory) RobotTrajectory(team.gif.lib.RobotTrajectory)

Aggregations

Trajectory (edu.wpi.first.math.trajectory.Trajectory)19 Pose2dFeet (team.gif.lib.Pose2dFeet)19 RobotTrajectory (team.gif.lib.RobotTrajectory)19