Skip to content

Commit

Permalink
Update at 'Sun Sep 29 14:11:47 PDT 2024'
Browse files Browse the repository at this point in the history
  • Loading branch information
mimizh2418 committed Sep 29, 2024
1 parent 5936ee6 commit 5e276e2
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ public void updateInputs(AprilTagVisionIOInputs inputs) {
DriverStation.isDisabled()
? LimelightHelpers.getBotPoseEstimate_wpiBlue(name)
: LimelightHelpers.getBotPoseEstimate_wpiBlue_MegaTag2(name);
Pose3d limelightPose = new Pose3d(measurement.pose);
inputs.estimatedPoseMeters = new Pose3d(
limelightPose.getX(),
limelightPose.getY() + 0.105,
limelightPose.getZ(),
limelightPose.getRotation());
inputs.lastMeasurementTimestampSecs = measurement.timestampSeconds;
inputs.numTagsSeen = measurement.tagCount;
inputs.seenTagIDs = Arrays.stream(measurement.rawFiducials).mapToInt(fiducial -> fiducial.id).toArray();
inputs.avgTagDistance = measurement.avgTagDist;
if (measurement.pose != null) {
Pose3d limelightPose = new Pose3d(measurement.pose);
inputs.estimatedPoseMeters = new Pose3d(
limelightPose.getX(),
limelightPose.getY() + 0.105,
limelightPose.getZ(),
limelightPose.getRotation());
inputs.lastMeasurementTimestampSecs = measurement.timestampSeconds;
inputs.numTagsSeen = measurement.tagCount;
inputs.seenTagIDs = Arrays.stream(measurement.rawFiducials).mapToInt(fiducial -> fiducial.id).toArray();
inputs.avgTagDistance = measurement.avgTagDist;
}
}

@Override
Expand Down

0 comments on commit 5e276e2

Please sign in to comment.