Hi,
When I try to use detect_aruco_markers node, I get the following error:
/opt/ros/galactic/bin/ros2:6: DeprecationWarning: pkg_resources is deprecated as an API. See Package Discovery and Resource Access using pkg_resources - setuptools 69.0.2.post20231206 documentation
- from pkg_resources import load_entry_point*
[INFO] [launch]: All log files can be found below /home/hello-robot/.ros/log/2023-12-12-15-36-24-986549-stretch-re1-1049-7007
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [detect_aruco_markers-1]: process started with pid [7009]
[detect_aruco_markers-1] [INFO] [1702416986.299282752] [detect_aruco_node]: detect_aruco_node started
[detect_aruco_markers-1] /home/hello-robot/ament_ws/install/stretch_core/lib/stretch_core/detect_aruco_markers:6: DeprecationWarning: pkg_resources is deprecated as an API. See Package Discovery and Resource Access using pkg_resources - setuptools 69.0.2.post20231206 documentation
[detect_aruco_markers-1] from pkg_resources import load_entry_point
[detect_aruco_markers-1] Traceback (most recent call last):
[detect_aruco_markers-1] File “/home/hello-robot/ament_ws/install/stretch_core/lib/stretch_core/detect_aruco_markers”, line 11, in
[detect_aruco_markers-1] load_entry_point(‘stretch-core==0.2.0’, ‘console_scripts’, ‘detect_aruco_markers’)()
[detect_aruco_markers-1] File “/home/hello-robot/ament_ws/install/stretch_core/lib/python3.8/site-packages/stretch_core/detect_aruco_markers.py”, line 811, in main
[detect_aruco_markers-1] rclpy.spin(node)
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/rclpy/init.py”, line 196, in spin
[detect_aruco_markers-1] executor.spin_once()
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py”, line 713, in spin_once
[detect_aruco_markers-1] raise handler.exception()
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/rclpy/task.py”, line 239, in call
[detect_aruco_markers-1] self._handler.send(None)
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py”, line 418, in handler
[detect_aruco_markers-1] await call_coroutine(entity, arg)
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py”, line 343, in _execute_subscription
[detect_aruco_markers-1] await await_or_execute(sub.callback, msg)
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py”, line 107, in await_or_execute
[detect_aruco_markers-1] return callback(args)
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/message_filters/init.py”, line 83, in callback
[detect_aruco_markers-1] self.signalMessage(msg)
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/message_filters/init.py”, line 64, in signalMessage
[detect_aruco_markers-1] cb((msg + args))
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/message_filters/init.py”, line 237, in add
[detect_aruco_markers-1] self.signalMessage(msgs)
[detect_aruco_markers-1] File “/opt/ros/galactic/lib/python3.8/site-packages/message_filters/init.py”, line 64, in signalMessage
[detect_aruco_markers-1] cb((msg + args))
[detect_aruco_markers-1] File “/home/hello-robot/ament_ws/install/stretch_core/lib/python3.8/site-packages/stretch_core/detect_aruco_markers.py”, line 692, in image_callback
[detect_aruco_markers-1] self.aruco_marker_collection.update(self.rgb_image, self.camera_info, self.depth_image, self.rgb_image_timestamp)
[detect_aruco_markers-1] File “/home/hello-robot/ament_ws/install/stretch_core/lib/python3.8/site-packages/stretch_core/detect_aruco_markers.py”, line 569, in update
[detect_aruco_markers-1] self.aruco_corners, self.aruco_ids, aruco_rejected_image_points = aruco.detectMarkers(self.gray_image,
[detect_aruco_markers-1] AttributeError: module ‘cv2.aruco’ has no attribute ‘detectMarkers’
[ERROR] [detect_aruco_markers-1]: process has died [pid 7009, exit code 1, cmd ‘/home/hello-robot/ament_ws/install/stretch_core/lib/stretch_core/detect_aruco_markers --ros-args --params-file /home/hello-robot/ament_ws/install/stretch_core/share/stretch_core/config/stretch_marker_dict.yaml’].
It seems that there is a problem in openCV. Similar error occured in ROS, but when I updated my ROS workspace, it was fixed. I tried to do same with ament workspace, but did not work because of version issue. How can I solve this issue?