Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distance limit #136

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apriltag_ros/config/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions apriltag_ros/include/apriltag_ros/common_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class TagDetector

// AprilTag 2 code's attributes
std::string family_;
double detection_distance_;
int threads_;
double decimate_;
double blur_;
Expand Down
7 changes: 5 additions & 2 deletions apriltag_ros/src/common_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -53,7 +53,8 @@ TagDetector::TagDetector(ros::NodeHandle pnh) :
refine_edges_(getAprilTagOption<int>(pnh, "tag_refine_edges", 1)),
debug_(getAprilTagOption<int>(pnh, "tag_debug", 0)),
max_hamming_distance_(getAprilTagOption<int>(pnh, "max_hamming_dist", 2)),
publish_tf_(getAprilTagOption<bool>(pnh, "publish_tf", false))
publish_tf_(getAprilTagOption<bool>(pnh, "publish_tf", false)),
detection_distance_(getAprilTagOption<double>(pnh,"detection_distance",1.0))
{
// Parse standalone tag descriptions specified by user (stored on ROS
// parameter server)
Expand Down Expand Up @@ -352,6 +353,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.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());
}
Expand Down