Skip to content

Commit

Permalink
Fix eigen memes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Oct 14, 2023
1 parent e04e3a1 commit 1917fb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 4 additions & 7 deletions photon-lib/src/main/native/cpp/photonlib/PhotonPoseEstimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <utility>
#include <vector>

#include <Eigen/Core>
#include <frc/Errors.h>
#include <frc/geometry/Pose3d.h>
#include <frc/geometry/Rotation3d.h>
Expand Down Expand Up @@ -337,21 +338,17 @@ frc::Pose3d detail::ToPose3d(const cv::Mat& tvec, const cv::Mat& rvec) {
R = R.t(); // rotation of inverse
cv::Mat tvecI = -R * tvec; // translation of inverse

Vectord<3> tv;
Eigen::Matrix<double, 3, 1> tv;
tv[0] = +tvecI.at<double>(2, 0);
tv[1] = -tvecI.at<double>(0, 0);
tv[2] = -tvecI.at<double>(1, 0);
Vectord<3> rv;
Eigen::Matrix<double, 3, 1> rv;
rv[0] = +rvec.at<double>(2, 0);
rv[1] = -rvec.at<double>(0, 0);
rv[2] = +rvec.at<double>(1, 0);

return Pose3d(Translation3d(meter_t{tv[0]}, meter_t{tv[1]}, meter_t{tv[2]}),
Rotation3d(
// radian_t{rv[0]},
// radian_t{rv[1]},
// radian_t{rv[2]}
rv, radian_t{rv.norm()}));
Rotation3d(rv));
}

std::optional<EstimatedRobotPose> PhotonPoseEstimator::MultiTagPnpStrategy(
Expand Down
3 changes: 0 additions & 3 deletions shared/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,3 @@ jacocoTestReport {
}))
}
}



0 comments on commit 1917fb7

Please sign in to comment.