Skip to content

Commit

Permalink
Updated note filtering and made drive assist the default
Browse files Browse the repository at this point in the history
  • Loading branch information
danjburke12 committed Jul 22, 2024
1 parent 4fed08d commit 7086f19
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class DriveWithAssist extends Command {
new LoggedTunableNumber(kLoggingPrefix + "TranslationKd", 0.0);

private static final double kTranslationTolerance = 0.01;
private static final double kMaxTranslationPIDOutput = 0.5;
private static final double kMaxTranslationPIDOutput = 0.75;

private final Drive mDrive;
private final RobotState mRobotState;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/team1701/robot/states/RobotState.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ public void periodic() {

mDetectedNoteForPickup = mDetectedNotes.stream()
.filter(note -> GeometryUtil.isNear(
robotRotationReverse,
(fieldRelativeSpeeds.vxMetersPerSecond > 0 && fieldRelativeSpeeds.vyMetersPerSecond > 0)
? robotPoseWithDirection.getRotation()
: robotRotationReverse,
GeometryUtil.getTranslation2d(note.pose())
.minus(robotTranslation)
.getAngle(),
Rotation2d.fromDegrees(35)))
Rotation2d.fromDegrees(25)))
.min((note1, note2) -> Double.compare(
rankNote(note1, robotPoseWithDirection), rankNote(note2, robotPoseWithDirection)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public Drive(GyroIO gyroIO, SwerveModuleIO[] moduleIOs, RobotState robotState) {
.ignoringDisable(true)
.withName("DriveEnabledStart"));

mUseDriveAssist = false;
mUseDriveAssist = true;
}

@Override
Expand Down

0 comments on commit 7086f19

Please sign in to comment.