@@ -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