From d4a9b51c191243e9052322ffb4848f1c14fbaeaa Mon Sep 17 00:00:00 2001 From: tugbakara Date: Fri, 21 Oct 2022 10:43:38 +0300 Subject: [PATCH 1/4] Distance limit --- apriltag_ros/src/common_functions.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apriltag_ros/src/common_functions.cpp b/apriltag_ros/src/common_functions.cpp index 958c0e28..b6fce0d0 100644 --- a/apriltag_ros/src/common_functions.cpp +++ b/apriltag_ros/src/common_functions.cpp @@ -343,6 +343,8 @@ AprilTagDetectionArray TagDetector::detectTags ( tag_detection.pose = tag_pose; tag_detection.id.push_back(detection->id); tag_detection.size.push_back(tag_size); + // This pr chooses the distance limit to push detection array, default selection 1.4 meter. + if (tag_detection.pose.pose.pose.position.z < 1.4) tag_detection_array.detections.push_back(tag_detection); detection_names.push_back(standaloneDescription->frame_name()); } From 70338cd797ac7e06add89f6988a8f19fa0c29860 Mon Sep 17 00:00:00 2001 From: tugbakara Date: Fri, 21 Oct 2022 10:43:38 +0300 Subject: [PATCH 2/4] Distance limit From 139e040234621f3e6514961ddd5d00ae94c64d21 Mon Sep 17 00:00:00 2001 From: tugbakara Date: Fri, 21 Oct 2022 10:43:38 +0300 Subject: [PATCH 3/4] Distance limit From 9324bdb936196eea9084b87f1ffe00dfdaac6a71 Mon Sep 17 00:00:00 2001 From: tugbakara Date: Sun, 23 Jun 2024 23:24:43 +0300 Subject: [PATCH 4/4] distance param --- apriltag_ros/config/settings.yaml | 1 + apriltag_ros/include/apriltag_ros/common_functions.h | 1 + apriltag_ros/src/common_functions.cpp | 9 +++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apriltag_ros/config/settings.yaml b/apriltag_ros/config/settings.yaml index be33540b..9d98deff 100644 --- a/apriltag_ros/config/settings.yaml +++ b/apriltag_ros/config/settings.yaml @@ -11,3 +11,4 @@ max_hamming_dist: 2 # default: 2 (Tunable parameter with 2 being a goo # Other parameters publish_tf: true # default: false transport_hint: "raw" # default: raw, see http://wiki.ros.org/image_transport#Known_Transport_Packages for options +detection_distance: 1.0 \ No newline at end of file diff --git a/apriltag_ros/include/apriltag_ros/common_functions.h b/apriltag_ros/include/apriltag_ros/common_functions.h index 4363fa12..3a84c457 100644 --- a/apriltag_ros/include/apriltag_ros/common_functions.h +++ b/apriltag_ros/include/apriltag_ros/common_functions.h @@ -163,6 +163,7 @@ class TagDetector // AprilTag 2 code's attributes std::string family_; + double detection_distance_; int threads_; double decimate_; double blur_; diff --git a/apriltag_ros/src/common_functions.cpp b/apriltag_ros/src/common_functions.cpp index b6fce0d0..758f6ae2 100644 --- a/apriltag_ros/src/common_functions.cpp +++ b/apriltag_ros/src/common_functions.cpp @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * CbONSEQUETIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) @@ -53,7 +53,8 @@ TagDetector::TagDetector(ros::NodeHandle pnh) : refine_edges_(getAprilTagOption(pnh, "tag_refine_edges", 1)), debug_(getAprilTagOption(pnh, "tag_debug", 0)), max_hamming_distance_(getAprilTagOption(pnh, "max_hamming_dist", 2)), - publish_tf_(getAprilTagOption(pnh, "publish_tf", false)) + publish_tf_(getAprilTagOption(pnh, "publish_tf", false)), + detection_distance_(getAprilTagOption(pnh,"detection_distance",1.0)) { // Parse standalone tag descriptions specified by user (stored on ROS // parameter server) @@ -343,8 +344,8 @@ AprilTagDetectionArray TagDetector::detectTags ( tag_detection.pose = tag_pose; tag_detection.id.push_back(detection->id); tag_detection.size.push_back(tag_size); - // This pr chooses the distance limit to push detection array, default selection 1.4 meter. - if (tag_detection.pose.pose.pose.position.z < 1.4) + // This pr chooses the distance limit to push detection array, default selection 1.0 meter. + if (tag_detection.pose.pose.pose.position.z < detection_distance_) tag_detection_array.detections.push_back(tag_detection); detection_names.push_back(standaloneDescription->frame_name()); }