diff --git a/src/subsystems/navigation/aruco_bt/aruco_bt/aruco_node.py b/src/subsystems/navigation/aruco_bt/aruco_bt/aruco_node.py index fa4412d3..9bc75c94 100644 --- a/src/subsystems/navigation/aruco_bt/aruco_bt/aruco_node.py +++ b/src/subsystems/navigation/aruco_bt/aruco_bt/aruco_node.py @@ -37,6 +37,13 @@ def __init__(self): aruco_dict = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_4X4_50) aruco_params = cv2.aruco.DetectorParameters() + + # Tightening up parameters to reduce false positives + aruco_params.minMarkerPerimeterRate = 0.04 # rejects markers that are too small, default 0.03 + aruco_params.maxMarkerPerimeterRate = 2.0 # rejects markers that are too large, default 4.0 + aruco_params.polygonalApproxAccuracyRate = 0.02 # controls how loosely the detected contour is approximated to a quadrilateral, default 0.03 + aruco_params.errorCorrectionRate = 0.4 # controls how much error correction is applied, default 0.6 + self.aruco_detector_ = cv2.aruco.ArucoDetector(aruco_dict, aruco_params) self.tf_buffer_ = tf2_ros.Buffer()