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

Fix out of bounds indexes when retrieving camera matrix for rectified images (backport #47) #49

Merged
merged 1 commit into from
Jun 4, 2024
Merged
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 aruco_opencv/config/aruco_tracker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

marker_dict: 4X4_50

image_is_rectified: false
image_sub_compressed: false
image_sub_qos:
reliability: 2 # 0 - system default, 1 - reliable, 2 - best effort
Expand Down
4 changes: 2 additions & 2 deletions aruco_opencv/src/aruco_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ class ArucoTracker : public rclcpp_lifecycle::LifecycleNode
std::lock_guard<std::mutex> guard(cam_info_mutex_);

if (image_is_rectified_) {
for (int i = 0; i < 12; ++i) {
camera_matrix_.at<double>(i / 4, i % 4) = cam_info->p[i];
for (int i = 0; i < 9; ++i) {
camera_matrix_.at<double>(i / 3, i % 3) = cam_info->p[i + i / 3];
}
} else {
for (int i = 0; i < 9; ++i) {
Expand Down
Loading