Skip to content

Commit

Permalink
change align to amp to just pid
Browse files Browse the repository at this point in the history
  • Loading branch information
r4stered committed Sep 12, 2024
1 parent adf1115 commit 597b83b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
18 changes: 3 additions & 15 deletions src/main/cpp/subsystems/SwerveSubsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,21 +252,9 @@ SwerveSubsystem::PIDToPose(std::function<frc::Pose2d()> goalPose) {

frc2::CommandPtr SwerveSubsystem::AlignToAmp() {
// If we are close enough to the amp, just pid there
return frc2::cmd::Either(
PIDToPose([this] {
return frc::Pose2d{GetAmpLocation(), frc::Rotation2d{90_deg}};
}),
frc2::cmd::Sequence(
pathplanner::AutoBuilder::pathfindToPoseFlipped(
frc::Pose2d{GetFrontAmpLocation(),
frc::Rotation2d{90_deg}},
consts::swerve::pathplanning::constraints, 3_fps),
PIDToPose([this] {
return frc::Pose2d{GetAmpLocation(),
frc::Rotation2d{90_deg}};
})),
[this] { return IsNearAmp(); })
.WithName("AlignToAmp");
return PIDToPose([this] {
return frc::Pose2d{GetAmpLocation(), frc::Rotation2d{90_deg}};
}).WithName("AlignToAmp");
}

frc2::CommandPtr
Expand Down
2 changes: 1 addition & 1 deletion src/main/deploy/commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
980210a
adf1115

0 comments on commit 597b83b

Please sign in to comment.