summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-09-19 12:40:26 +0000
committerCoprDistGit <infra@openeuler.org>2026-09-19 12:40:26 +0000
commitb96707b6e51826073693d1d183b4f1c9ae8ac226 (patch)
tree0dd9eb12ef889c3e53cd0905cb084869b02b41b7
parent8c5130b56da614f98ad7618dd650a8007cc6c012 (diff)
automatic import of ros-humble-aruco-markers
-rw-r--r--aruco-markers.spec42
-rw-r--r--sources2
2 files changed, 38 insertions, 6 deletions
diff --git a/aruco-markers.spec b/aruco-markers.spec
index 26c80b4..64e7b7a 100644
--- a/aruco-markers.spec
+++ b/aruco-markers.spec
@@ -4,7 +4,7 @@
Name: ros-%{ros_distro}-%{RosPkgName}
Version: 0.0.3
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A ros2 node for detecting aruco markers in camera images
License: MIT
URL: https://github.com/namo-robotics/aruco_markers/tree/humble
@@ -46,11 +46,38 @@ A ros2 node for detecting aruco markers in camera images
%prep
%autosetup -n %{RosPkgName}-%{src_version}
-# OpenCV 4.5.x 不存在 opencv2/aruco/dictionary.hpp 子目录头文件,
-# 该文件是 OpenCV 4.6+ 引入的新路径;4.5.x 中所有 aruco 类型均在
-# opencv2/aruco.hpp 中,替换后源码保持完全兼容。
+# OpenCV 4.5.x API 兼容性修复:
+# 1. opencv2/aruco/dictionary.hpp 是 4.6+ 新路径,4.5.x 统一在 opencv2/aruco.hpp
sed -i 's|#include <opencv2/aruco/dictionary\.hpp>|#include <opencv2/aruco.hpp>|g' \
aruco_markers/include/aruco_markers/utils.hpp
+# 2. PREDEFINED_DICTIONARY_NAME 在 4.5.x 中是匿名枚举(底层 int),不能作为类型名
+sed -i 's|cv::aruco::PREDEFINED_DICTIONARY_NAME|int|g' \
+ aruco_markers/include/aruco_markers/utils.hpp \
+ aruco_markers/include/aruco_markers/aruco_markers.hpp \
+ aruco_markers/src/utils.cpp
+# 3. DetectorParameters::create() 在 4.5.x 中不存在,使用 cv::makePtr 构造
+sed -i 's|cv::aruco::DetectorParameters::create()|cv::makePtr<cv::aruco::DetectorParameters>()|g' \
+ aruco_markers/src/aruco_markers.cpp
+# 4. detectMarkers 4.5.x 签名无 camera_matrix/camera_distortion 参数(后两个可选参数已移除)
+python3 -c "
+import re, sys
+src = open('aruco_markers/src/aruco_markers.cpp').read()
+src = re.sub(
+ r'cv::aruco::detectMarkers\(\s*image,\s*aruco_dict_,\s*marker_corners,\s*marker_ids,\s*aruco_parameters_,\s*rejected_candidates,\s*camera_matrix_,\s*camera_distortion_\);',
+ 'cv::aruco::detectMarkers(\n image, aruco_dict_, marker_corners, marker_ids, aruco_parameters_,\n rejected_candidates);',
+ src)
+open('aruco_markers/src/aruco_markers.cpp', 'w').write(src)
+"
+# 5. drawAxis 在 4.5.x 中已更名为 drawFrameAxes
+python3 -c "
+import re, sys
+src = open('aruco_markers/src/aruco_markers.cpp').read()
+src = re.sub(
+ r'cv::aruco::drawAxis\(\s*image,\s*camera_matrix_,\s*camera_distortion_,\s*rvec,\s*tvec,\s*marker_size_\s*\*\s*0\.7f\);',
+ 'cv::aruco::drawFrameAxes(\n image, camera_matrix_, camera_distortion_, rvec, tvec,\n marker_size_ * 0.7f);',
+ src)
+open('aruco_markers/src/aruco_markers.cpp', 'w').write(src)
+"
%build
source /opt/ros/%{ros_distro}/setup.sh 2>/dev/null || true
@@ -80,9 +107,14 @@ make install DESTDIR=%{buildroot}
/opt/ros/%{ros_distro}
%changelog
+* Fri Sep 19 2026 ai-importer <ai-importer@openeuler.org> - 0.0.3-3
+- Fix full OpenCV 4.5.x API incompatibilities: replace PREDEFINED_DICTIONARY_NAME
+ type usage with int, DetectorParameters::create() with cv::makePtr, remove
+ extra detectMarkers args, replace drawAxis with drawFrameAxes
+
* Fri Sep 19 2026 ai-importer <ai-importer@openeuler.org> - 0.0.3-2
- Fix build failure: replace opencv2/aruco/dictionary.hpp with opencv2/aruco.hpp
to be compatible with OpenCV 4.5.x available in openEuler 24.03 LTS SP3
-* Sat Sep 19 2026 ai-importer <ai-importer@openeuler.org> - 0.0.3-1
+* Fri Sep 19 2026 ai-importer <ai-importer@openeuler.org> - 0.0.3-1
- Initial import (ROS batch)
diff --git a/sources b/sources
index 91b4982..6859871 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-ff001d25f9a0338cdcd5889748638262 aruco-markers-0.0.3-1.tar.gz
+f40710d299d3bd051e50749dc99ac175 aruco-markers-0.0.3-1.tar.gz