diff --git a/src/rm_auto_aim/armor_detector/include/armor_detector/armor_reproject.hpp b/src/rm_auto_aim/armor_detector/include/armor_detector/armor_reproject.hpp index e7800b9..1e94d57 100644 --- a/src/rm_auto_aim/armor_detector/include/armor_detector/armor_reproject.hpp +++ b/src/rm_auto_aim/armor_detector/include/armor_detector/armor_reproject.hpp @@ -50,12 +50,11 @@ namespace fyt::auto_aim { static inline std::vector getArmorCornerPoints(bool is_big) { double w = is_big ? LARGE_ARMOR_WIDTH : SMALL_ARMOR_WIDTH; double h = is_big ? LARGE_ARMOR_HEIGHT : SMALL_ARMOR_HEIGHT; - // Rotate 90 degrees: y' = z, z' = -y return std::vector{ - cv::Point3f(0, -h / 2, -w / 2), // 0: bottom-left (rotated) - cv::Point3f(0, h / 2, -w / 2), // 1: top-left (rotated) - cv::Point3f(0, h / 2, w / 2), // 2: top-right (rotated) - cv::Point3f(0, -h / 2, w / 2) // 3: bottom-right (rotated) + cv::Point3f(0, w / 2, -h / 2), // 0: bottom-left + cv::Point3f(0, w / 2, h / 2), // 1: top-left + cv::Point3f(0, -w / 2, h / 2), // 2: top-right + cv::Point3f(0, -w / 2, -h / 2) // 3: bottom-right }; } diff --git a/src/rm_auto_aim/armor_detector/src/armor_pose_estimator.cpp b/src/rm_auto_aim/armor_detector/src/armor_pose_estimator.cpp index 5032476..b66403d 100644 --- a/src/rm_auto_aim/armor_detector/src/armor_pose_estimator.cpp +++ b/src/rm_auto_aim/armor_detector/src/armor_pose_estimator.cpp @@ -55,8 +55,7 @@ std::vector ArmorPoseEstimator::extractArmorPoses( double armor_roll = rotationMatrixToRPY(R_gimbal_camera_ * R)[0] * 180 / M_PI; - // Force roll=0, pitch=15 degrees for reprojection consistency - R = forceRPY(R, 0.0, 15.0); + // No forced roll/pitch - use original PnP result if (use_ba_ && std::abs(armor_roll) < 15) { // Use BA alogorithm to optimize the pose from PnP