Skip to content

Commit 0a083c6

Browse files
committed
NT errors happened and then they didn't
1 parent 10e8736 commit 0a083c6

File tree

2 files changed

+6
-45
lines changed

2 files changed

+6
-45
lines changed

src/main/java/frc/robot/Robot.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public Robot() {
7676
break;
7777
}
7878

79+
//Uncomment if NT errors are occuring weirdly
80+
81+
// StringLogEntry entry = new StringLogEntry(DataLogManager.getLog(), "/ntlog");
82+
// NetworkTableInstance.getDefault().addLogger(0, 100,
83+
// event -> entry.append(event.logMessage.filename + ":" + event.logMessage.line + ":" + event.logMessage.message));
7984
// Initialize URCL
8085
Logger.registerURCL(URCL.startExternal());
8186

src/main/java/frc/robot/subsystems/drive/Drive.java

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public void periodic() {
271271
// Apply update
272272
poseEstimator.updateWithTime(sampleTimestamps[i], rawGyroRotation, modulePositions);
273273

274-
Pose2d visionPose = getRobotVisionPose();
274+
Pose2d visionPose = getRobotVisionPose();
275275
// if(visionPose != null){
276276
// // poseEstimator.addVisionMeasurement(visionPose, sampleTimestamps[i]);
277277
// }
@@ -308,54 +308,10 @@ private Pose2d getRobotVisionPose(){
308308
Logger.recordOutput("Limelight/RobotCalculatedPose", robotPoseField.pose);
309309
Logger.recordOutput("Limelight/RobotRelativeToAprilTag", robotPoseTagSpace.pose);
310310

311-
Logger.recordOutput("Limelight/TagPoseInRobotSpace", aprilTagRelativePose.pose);
312-
313-
314-
Logger.recordOutput("Limelight/TagLookupPose", actualTagCoord.pose);
315-
316-
317311
return robotPoseField.pose;
318312

319313
}
320314

321-
// private Pose2d getRobotVisionPose(){
322-
323-
// double[] limelightData = LimelightHelpers.getTargetPose_RobotSpace("limelight");
324-
// int tagId = (int)LimelightHelpers.getFiducialID("limelight");
325-
326-
// Optional<Pose3d> tagPose3d = AprilTagDataLoader.field.getTagPose(tagId);
327-
328-
// if(tagPose3d.isEmpty()) return null;
329-
330-
// Pose2d actualTagCoordTemp = new Pose2d(tagPose3d.get().getX(), tagPose3d.get().getY(), tagPose3d.get().getRotation().toRotation2d());
331-
// FieldCoordinatePose2d actualTagCoord = new FieldCoordinatePose2d(actualTagCoordTemp);
332-
333-
// RelativeCoordinatePose2d aprilTagRelativePose = new RelativeCoordinatePose2d(Help.limelightCoordsToWPICoordsPose2d(limelightData));
334-
// RelativeCoordinatePose2d robotPoseRelativeToTag = new RelativeCoordinatePose2d(new Pose2d(
335-
// -aprilTagRelativePose.pose.getX(),
336-
// -aprilTagRelativePose.pose.getY(),
337-
// aprilTagRelativePose.pose.getRotation().rotateBy(new Rotation2d(Math.PI))
338-
// ));
339-
340-
// Logger.recordOutput("Limelight/RobotRelativeToTag", robotPoseRelativeToTag.pose);
341-
342-
343-
// FieldCoordinatePose2d robotCalculatedPoseFieldSpace = robotPoseRelativeToTag.toFieldSpace(actualTagCoord);
344-
345-
346-
// Logger.recordOutput("Limelight/TagLookupPose", actualTagCoord.pose);
347-
// Logger.recordOutput("Limelight/CalculatedRobotPose", robotCalculatedPoseFieldSpace.pose);
348-
349-
350-
// return robotCalculatedPoseFieldSpace.pose;
351-
352-
// }
353-
354-
355-
356-
357-
358-
359315

360316
/**
361317
* Runs the drive at the desired velocity.

0 commit comments

Comments
 (0)