From 476291305b7b4d5d775103239822780937b508e0 Mon Sep 17 00:00:00 2001 From: IanTapply22 Date: Mon, 8 Jan 2024 09:22:36 -0500 Subject: [PATCH] Update pathplanner vendordep and related code --- .../robot/subsystems/drive/DriveSubsystem.java | 18 +++++++++++++++++- vendordeps/PathplannerLib.json | 10 ++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/drive/DriveSubsystem.java b/src/main/java/frc/robot/subsystems/drive/DriveSubsystem.java index 33e576e..798591c 100644 --- a/src/main/java/frc/robot/subsystems/drive/DriveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/drive/DriveSubsystem.java @@ -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; @@ -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) -> @@ -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); } @@ -73,6 +81,14 @@ public Command applyRequest(Supplier 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 * diff --git a/vendordeps/PathplannerLib.json b/vendordeps/PathplannerLib.json index a92663b..e334459 100644 --- a/vendordeps/PathplannerLib.json +++ b/vendordeps/PathplannerLib.json @@ -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": [ @@ -12,7 +12,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-java", - "version": "2024.0.0-beta-6.2" + "version": "2024.1.1" } ], "jniDependencies": [], @@ -20,7 +20,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-cpp", - "version": "2024.0.0-beta-6.2", + "version": "2024.1.1", "libName": "PathplannerLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -29,7 +29,9 @@ "windowsx86-64", "linuxx86-64", "osxuniversal", - "linuxathena" + "linuxathena", + "linuxarm32", + "linuxarm64" ] } ]