Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 2136919

Browse files
committed
add logging for heursitic path tracker
1 parent 9e6dd44 commit 2136919

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/main/java/frc/robot/autos/AutoChooser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public AutoChooser(RobotManager robotManager, Trailblazer trailblazer) {
1717
}
1818

1919
chooser.setDefaultOption(
20-
AutoSelection.DO_NOTHING.toString(),
21-
AutoSelection.DO_NOTHING.auto.apply(robotManager, trailblazer));
20+
AutoSelection.OP.toString(),
21+
AutoSelection.OP.auto.apply(robotManager, trailblazer));
2222
}
2323

2424
public BaseAuto getSelectedAuto() {

src/main/java/frc/robot/autos/trailblazer/trackers/HeuristicPathTracker.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33
import edu.wpi.first.math.geometry.Pose2d;
44
import edu.wpi.first.math.kinematics.ChassisSpeeds;
55
import frc.robot.autos.trailblazer.AutoPoint;
6+
67
import java.util.List;
78

9+
import dev.doglog.DogLog;
10+
811
// TODO: Implement https://github.com/team581/2024-offseason-bot/issues/94
912
public class HeuristicPathTracker implements PathTracker {
1013
private List<AutoPoint> points = List.of();
1114
private Pose2d currentPose = new Pose2d();
1215
private double proximityRadius = 0.5;
1316
private int currentPointIndex = 0;
1417

18+
1519
@Override
1620
public void resetAndSetPoints(List<AutoPoint> points) {
1721
this.points = points;
@@ -29,14 +33,24 @@ public Pose2d getTargetPose() {
2933
}
3034
AutoPoint currentPoint = points.get(getCurrentPointIndex());
3135
Pose2d currentTargetPose = currentPoint.poseSupplier.get();
36+
37+
/// DogLog.log("Autos/Trailblazer/CurrentWaypoint", currentPoint);
38+
DogLog.log("Autos/Trailblazer/NextPointIndex", currentPointIndex);
39+
DogLog.log("Autos/Trailblazer/CurrentTargetPose", currentTargetPose);
40+
3241
double distanceToTarget =
3342
currentPose.getTranslation().getDistance(currentTargetPose.getTranslation());
3443

3544
if (distanceToTarget < proximityRadius && currentPointIndex < points.size() - 1) {
3645
currentPointIndex++;
3746
}
3847

39-
return points.get(currentPointIndex).poseSupplier.get();
48+
var targetPose = points.get(currentPointIndex).poseSupplier.get();
49+
50+
DogLog.log("Autos/Trailblazer/TargetPose", targetPose);
51+
DogLog.log("Autos/Trailblazer/DistanceToTarget", distanceToTarget);
52+
53+
return targetPose;
4054
}
4155

4256
@Override
@@ -48,4 +62,5 @@ public int getCurrentPointIndex() {
4862
public boolean isFinished() {
4963
return false;
5064
}
65+
5166
}

0 commit comments

Comments
 (0)