Skip to content

Commit

Permalink
Fix compilation with Clang 15
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Feb 24, 2025
1 parent 113cac6 commit e44f33e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion wpical/src/main/native/cpp/WPIcal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,9 @@ void CombineCalibrations() {
if (layoutPath != "") {
auto tagPose = calibratedFieldLayouts[layoutPath].GetTagPose(tagId);
if (tagPose) {
tags.emplace_back(tagId, tagPose.value());
// TODO: remove variable when clang 16 is available on Mac
frc::AprilTag tag{tagId, tagPose.value()};
tags.emplace_back(tag);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion wpical/src/main/native/cpp/fieldcalibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ std::optional<frc::AprilTagFieldLayout> fieldcalibration::calibrate(
// Transformation from world
Eigen::Matrix4d correctedTransform =
pinnedTagTransform * correctionA * transform * correctionB;
tags.emplace_back(tagId, frc::Pose3d{correctedTransform});
frc::AprilTag tag{tagId, frc::Pose3d{correctedTransform}};
tags.emplace_back(tag);
}
return frc::AprilTagFieldLayout{tags, idealLayout.GetFieldLength(),
idealLayout.GetFieldWidth()};
Expand Down
6 changes: 4 additions & 2 deletions wpical/src/main/native/cpp/fmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ Fieldmap::Fieldmap(std::string type, std::vector<Fiducial> fiducials)
Fieldmap::Fieldmap(const frc::AprilTagFieldLayout& layout) : type("frc") {
// https://docs.limelightvision.io/docs/docs-limelight/pipeline-apriltag/apriltag-map-specification
for (auto tag : layout.GetTags()) {
fiducials.emplace_back("apriltag3_36h11_classic", tag.ID, 165.1,
tag.pose.ToMatrix(), 1);
// TODO: remove variable when clang 16 is available on Mac
Fiducial fiducial{"apriltag3_36h11_classic", tag.ID, 165.1,
tag.pose.ToMatrix(), 1};
fiducials.emplace_back(fiducial);
}
}

Expand Down

0 comments on commit e44f33e

Please sign in to comment.