Skip to content

Commit

Permalink
Update pathplanner vendordep and related code
Browse files Browse the repository at this point in the history
  • Loading branch information
IanTapply22 committed Jan 8, 2024
1 parent 5bbdfa6 commit 4762913
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
18 changes: 17 additions & 1 deletion src/main/java/frc/robot/subsystems/drive/DriveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.kinematics.ChassisSpeeds;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Notifier;
import edu.wpi.first.wpilibj.RobotController;
import edu.wpi.first.wpilibj2.command.Command;
Expand Down Expand Up @@ -44,7 +45,7 @@ private void configurePathPlanner() {
}

AutoBuilder.configureHolonomic(
() -> this.getState().Pose, // Supplier of current robot pose
this::getPose, // Supplier of current robot pose
this::seedFieldRelative, // Consumer for seeding pose against auto
this::getCurrentRobotChassisSpeeds,
(speeds) ->
Expand All @@ -56,6 +57,13 @@ private void configurePathPlanner() {
DriveConstants.kSpeedAt12VoltsMps,
driveBaseRadius,
new ReplanningConfig()),
() -> {
var alliance = DriverStation.getAlliance();
if (alliance.isPresent()) {
return alliance.get() == DriverStation.Alliance.Red;
}
return false;
},
this);
}

Expand All @@ -73,6 +81,14 @@ public Command applyRequest(Supplier<SwerveRequest> requestSupplier) {
this);
}

/**
* Returns the current pose of the robot
* @return The robots pose in a Pose2d object
*/
public Pose2d getPose() {
return this.getState().Pose;
}

/**
* Returns a command that will run the specified pathplanner path
*
Expand Down
10 changes: 6 additions & 4 deletions vendordeps/PathplannerLib.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "PathplannerLib.json",
"name": "PathplannerLib",
"version": "2024.0.0-beta-6.2",
"version": "2024.1.1",
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
"frcYear": "2024",
"mavenUrls": [
Expand All @@ -12,15 +12,15 @@
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-java",
"version": "2024.0.0-beta-6.2"
"version": "2024.1.1"
}
],
"jniDependencies": [],
"cppDependencies": [
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-cpp",
"version": "2024.0.0-beta-6.2",
"version": "2024.1.1",
"libName": "PathplannerLib",
"headerClassifier": "headers",
"sharedLibrary": false,
Expand All @@ -29,7 +29,9 @@
"windowsx86-64",
"linuxx86-64",
"osxuniversal",
"linuxathena"
"linuxathena",
"linuxarm32",
"linuxarm64"
]
}
]
Expand Down

0 comments on commit 4762913

Please sign in to comment.