Skip to content

Commit

Permalink
actually fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan1522 committed Oct 6, 2024
1 parent 6eb8b3a commit 5b79e88
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 196 deletions.
17 changes: 0 additions & 17 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import com.ctre.phoenix6.signals.InvertedValue;
import com.ctre.phoenix6.signals.SensorDirectionValue;
import com.pathplanner.lib.path.PathConstraints;
import com.pathplanner.lib.util.HolonomicPathFollowerConfig;
import com.pathplanner.lib.util.PIDConstants;
import com.pathplanner.lib.util.ReplanningConfig;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.kinematics.SwerveDriveKinematics;
Expand Down Expand Up @@ -543,24 +539,11 @@ public static final class TrajectoryConstants {
public static final double MAX_ANGULAR_SPEED_RADIANS_PER_SECOND = 2;
public static final double MAX_ANGULAR_SPEED_RADIANS_PER_SECOND_SQUARED = 2;

public static final PIDConstants REALTIME_TRANSLATION_PID = new PIDConstants(0.5, 0, 0); // 0.2
public static final PIDConstants REALTIME_THETA_PID = new PIDConstants(15, 0, 0); // 0.1
public static final HolonomicPathFollowerConfig CONFIG =
new HolonomicPathFollowerConfig(
REALTIME_TRANSLATION_PID, REALTIME_THETA_PID, MAX_SPEED, 0.876, new ReplanningConfig());

// Constraint for the motion profiled robot angle controller
public static final TrapezoidProfile.Constraints THETA_CONTROLLER_CONSTRAINTS =
new TrapezoidProfile.Constraints(
MAX_ANGULAR_SPEED_RADIANS_PER_SECOND, MAX_ANGULAR_SPEED_RADIANS_PER_SECOND_SQUARED);

public static final PathConstraints PATH_CONSTRAINTS =
new PathConstraints(
MAX_SPEED,
MAX_ACCELERATION,
MAX_ANGULAR_SPEED_RADIANS_PER_SECOND,
MAX_ANGULAR_SPEED_RADIANS_PER_SECOND_SQUARED);

public static final double X_TOLERANCE = 0.02;
public static final double Y_TOLERANCE = 0.02;
public static final double THETA_TOLERANCE = 1.25;
Expand Down
153 changes: 0 additions & 153 deletions src/main/java/frc/robot/extras/LocalADStarAK.java

This file was deleted.

26 changes: 0 additions & 26 deletions src/main/java/frc/robot/subsystems/swerve/Drive.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package frc.robot.subsystems.swerve;

import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.pathfinding.Pathfinding;
import com.pathplanner.lib.util.PathPlannerLogging;
import edu.wpi.first.math.VecBuilder;
import edu.wpi.first.math.estimator.SwerveDrivePoseEstimator;
import edu.wpi.first.math.geometry.Pose2d;
Expand All @@ -18,7 +15,6 @@
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants.DriveConstants;
import frc.robot.Constants.TrajectoryConstants;
import frc.robot.extras.LocalADStarAK;
import java.util.Optional;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
Expand Down Expand Up @@ -61,28 +57,6 @@ public Drive(
// Start threads (no-op for each if no signals have been created)
PhoenixOdometryThread.getInstance().start();

// Configure AutoBuilder for PathPlanner
AutoBuilder.configureHolonomic(
this::getPose,
this::setPose,
() -> DriveConstants.DRIVE_KINEMATICS.toChassisSpeeds(getModuleStates()),
this::runVelocity,
TrajectoryConstants.CONFIG,
() ->
DriverStation.getAlliance().isPresent()
&& DriverStation.getAlliance().get() == Alliance.Red,
this);
Pathfinding.setPathfinder(new LocalADStarAK());
PathPlannerLogging.setLogActivePathCallback(
(activePath) -> {
Logger.recordOutput(
"Odometry/Trajectory", activePath.toArray(new Pose2d[activePath.size()]));
});
PathPlannerLogging.setLogTargetPoseCallback(
(targetPose) -> {
Logger.recordOutput("Odometry/TrajectorySetpoint", targetPose);
});

alliance = DriverStation.getAlliance();
}

Expand Down

0 comments on commit 5b79e88

Please sign in to comment.