Skip to content

Commit

Permalink
testing in sim
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchen20 committed Aug 16, 2024
1 parent 18a691d commit 8467354
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions src/main/java/frc/robot/BuildConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
/** Automatically generated file containing build version information. */
public final class BuildConstants {
public static final String MAVEN_GROUP = "";
public static final String MAVEN_NAME = "2024 Robot Code";
public static final String MAVEN_NAME = "2024RobotCode";
public static final String VERSION = "unspecified";
public static final int GIT_REVISION = 328;
public static final String GIT_SHA = "2b21d6b98cde049db5aee43e214983d0f90a2076";
public static final String GIT_DATE = "2024-08-14 20:38:25 EDT";
public static final String GIT_BRANCH = "pre-marc";
public static final String BUILD_DATE = "2024-08-14 20:39:57 EDT";
public static final long BUILD_UNIX_TIME = 1723682397590L;
public static final int GIT_REVISION = 339;
public static final String GIT_SHA = "18a691d2f6d19e87115ebcd3031c38f6abed2138";
public static final String GIT_DATE = "2024-08-16 15:05:13 EDT";
public static final String GIT_BRANCH = "marc";
public static final String BUILD_DATE = "2024-08-16 15:06:33 EDT";
public static final long BUILD_UNIX_TIME = 1723835193555L;
public static final int DIRTY = 1;

private BuildConstants() {}
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/frc/robot/subsystems/drive/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import frc.robot.util.LimelightHelpers.PoseEstimate;
import frc.robot.util.LimelightHelpers.RawFiducial;
import frc.robot.util.LocalADStarAK;

import java.util.HashMap;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -735,25 +734,28 @@ public Translation2d getTargetNoteLocation() {
Translation2d fieldCoords = noteLocations.get(getNote());
boolean useVisionNoteCoords =
getCachedNoteLocation().getDistance(fieldCoords) < 1.25
&& getCachedNoteLocation() != null && getCachedNoteTime() != -1 && noteImageIsNew();
&& getCachedNoteLocation() != null
&& getCachedNoteTime() != -1
&& noteImageIsNew();

Logger.recordOutput(
"cached note distance to field ", getCachedNoteLocation().getDistance(fieldCoords));
"cached note distance to field ", getCachedNoteLocation().getDistance(fieldCoords));
Logger.recordOutput("use vision note coords", useVisionNoteCoords);

if (useVisionNoteCoords) return visionCoords;
return fieldCoords;
}

public PathPlannerPath generateTrajectoryToNote(
public PathPlannerPath generateTrajectoryToNote(
Translation2d target,
double maxVelMetersPerSec,
double maxAccelMetersPerSecSquared,
double maxAngVelDegPerSec,
double maxAngAccelDegPerSecSquared,
double endVelMetersPerSec) {
Rotation2d targetRotation =
AllianceFlipUtil.apply(new Rotation2d(target.getX() - getPose().getX(), target.getY() - getPose().getY()));
AllianceFlipUtil.apply(
new Rotation2d(target.getX() - getPose().getX(), target.getY() - getPose().getY()));

Logger.recordOutput("Target Note Pose3d", new Pose3d(new Pose2d(target, new Rotation2d())));
List<Translation2d> points =
Expand Down

0 comments on commit 8467354

Please sign in to comment.