mgonzs13 / yolo_ros

Ultralytics YOLOv8, YOLOv9, YOLOv10, YOLOv11 for ROS 2
GNU General Public License v3.0
336 stars 89 forks source link

AttributeError: module 'rclpy._rclpy' has no attribute 'TransitionCallbackReturnType' #47

Open yangyy11 opened 3 months ago

yangyy11 commented 3 months ago

when execute: ros2 launch yolov8_bringup yolov8.launch.py error:

managed_entity.py", line 20, in [debug_node-3] TransitionCallbackReturn = _rclpy.TransitionCallbackReturnType [debug_node-3] AttributeError: module 'rclpy._rclpy' has no attribute 'TransitionCallbackReturnType'

mgonzs13 commented 3 months ago

Hi @yangyy11, can you give more info (logs, ROS 2 distro)?

yangyy11 commented 3 months ago

ubuntu 20.04, foxy launch.log:

1722616962.4983020 [INFO] [launch]: All log files can be found below /home/yanght/.ros/log/2024-08-03-00-42-42-494167-yanght-Latitude-E6540-410019 1722616962.4986501 [INFO] [launch]: Default logging verbosity is set to INFO 1722616962.6235681 [INFO] [yolov8_node-1]: process started with pid [410038] 1722616962.6237512 [INFO] [tracking_node-2]: process started with pid [410040] 1722616962.6238539 [INFO] [debug_node-3]: process started with pid [410042] 1722616963.0370116 [tracking_node-2] Traceback (most recent call last): 1722616963.0371699 [tracking_node-2] File "/home/yanght/new_ws/install/yolov8_ros/lib/yolov8_ros/tracking_node", line 11, in 1722616963.0372674 [tracking_node-2] load_entry_point('yolov8-ros==0.0.0', 'console_scripts', 'tracking_node')() 1722616963.0373387 [tracking_node-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point 1722616963.0373991 [tracking_node-2] return get_distribution(dist).load_entry_point(group, name) 1722616963.0374532 [tracking_node-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point 1722616963.0375021 [tracking_node-2] return ep.load() 1722616963.0375509 [tracking_node-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load 1722616963.0375967 [tracking_node-2] return self.resolve() 1722616963.0376418 [tracking_node-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve 1722616963.0376859 [tracking_node-2] module = import(self.module_name, fromlist=['name'], level=0) 1722616963.0377283 [tracking_node-2] File "/home/yanght/new_ws/install/yolov8_ros/lib/python3.8/site-packages/yolov8_ros/tracking_node.py", line 22, in 1722616963.0377717 [tracking_node-2] from rclpy.lifecycle import LifecycleNode 1722616963.0378146 [tracking_node-2] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/lifecycle/init.py", line 15, in 1722616963.0378575 [tracking_node-2] from .managed_entity import ManagedEntity 1722616963.0378997 [tracking_node-2] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/lifecycle/managed_entity.py", line 20, in 1722616963.0379419 [tracking_node-2] TransitionCallbackReturn = _rclpy.TransitionCallbackReturnType 1722616963.0379837 [tracking_node-2] AttributeError: module 'rclpy._rclpy' has no attribute 'TransitionCallbackReturnType' 1722616963.0386460 [yolov8_node-1] Traceback (most recent call last): 1722616963.0387259 [yolov8_node-1] File "/home/yanght/new_ws/install/yolov8_ros/lib/yolov8_ros/yolov8_node", line 11, in 1722616963.0387824 [yolov8_node-1] load_entry_point('yolov8-ros==0.0.0', 'console_scripts', 'yolov8_node')() 1722616963.0388527 [yolov8_node-1] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point 1722616963.0388994 [yolov8_node-1] return get_distribution(dist).load_entry_point(group, name) 1722616963.0389438 [yolov8_node-1] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point 1722616963.0389876 [yolov8_node-1] return ep.load() 1722616963.0390313 [yolov8_node-1] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load 1722616963.0390749 [yolov8_node-1] return self.resolve() 1722616963.0391173 [yolov8_node-1] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve 1722616963.0391593 [yolov8_node-1] module = import(self.module_name, fromlist=['name'], level=0) 1722616963.0392010 [yolov8_node-1] File "/home/yanght/new_ws/install/yolov8_ros/lib/python3.8/site-packages/yolov8_ros/yolov8_node.py", line 24, in 1722616963.0392427 [yolov8_node-1] from rclpy.lifecycle import LifecycleNode 1722616963.0392842 [yolov8_node-1] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/lifecycle/init.py", line 15, in 1722616963.0393257 [yolov8_node-1] from .managed_entity import ManagedEntity 1722616963.0393665 [yolov8_node-1] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/lifecycle/managed_entity.py", line 20, in 1722616963.0394177 [yolov8_node-1] TransitionCallbackReturn = _rclpy.TransitionCallbackReturnType 1722616963.0394619 [yolov8_node-1] AttributeError: module 'rclpy._rclpy' has no attribute 'TransitionCallbackReturnType' 1722616963.0698950 [ERROR] [tracking_node-2]: process has died [pid 410040, exit code 1, cmd '/home/yanght/new_ws/install/yolov8_ros/lib/yolov8_ros/tracking_node --ros-args -r node:=tracking_node -r ns:=/yolo --params-file /tmp/launch_paramsjole9z0 -r image_raw:=/camera/rgb/image_raw']. 1722616963.0835125 [ERROR] [yolov8_node-1]: process has died [pid 410038, exit code 1, cmd '/home/yanght/new_ws/install/yolov8_ros/lib/yolov8_ros/yolov8_node --ros-args -r node:=yolov8_node -r ns:=/yolo --params-file /tmp/launch_params_ygdbsmrp -r image_raw:=/camera/rgb/image_raw']. 1722616963.3321276 [debug_node-3] Traceback (most recent call last): 1722616963.3323393 [debug_node-3] File "/home/yanght/new_ws/install/yolov8_ros/lib/yolov8_ros/debug_node", line 11, in 1722616963.3324962 [debug_node-3] load_entry_point('yolov8-ros==0.0.0', 'console_scripts', 'debug_node')() 1722616963.3326292 [debug_node-3] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point 1722616963.3327560 [debug_node-3] return get_distribution(dist).load_entry_point(group, name) 1722616963.3328726 [debug_node-3] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point 1722616963.3329873 [debug_node-3] return ep.load() 1722616963.3330908 [debug_node-3] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load 1722616963.3331656 [debug_node-3] return self.resolve() 1722616963.3332410 [debug_node-3] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve 1722616963.3333163 [debug_node-3] module = import(self.module_name, fromlist=['name'], level=0) 1722616963.3333912 [debug_node-3] File "/home/yanght/new_ws/install/yolov8_ros/lib/python3.8/site-packages/yolov8_ros/debug_node.py", line 28, in 1722616963.3334632 [debug_node-3] from rclpy.lifecycle import LifecycleNode 1722616963.3335359 [debug_node-3] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/lifecycle/init.py", line 15, in 1722616963.3336074 [debug_node-3] from .managed_entity import ManagedEntity 1722616963.3336778 [debug_node-3] File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/lifecycle/managed_entity.py", line 20, in 1722616963.3337500 [debug_node-3] TransitionCallbackReturn = _rclpy.TransitionCallbackReturnType 1722616963.3338187 [debug_node-3] AttributeError: module 'rclpy._rclpy' has no attribute 'TransitionCallbackReturnType' 1722616963.3924141 [ERROR] [debug_node-3]: process has died [pid 410042, exit code 1, cmd '/home/yanght/new_ws/install/yolov8_ros/lib/yolov8_ros/debug_node --ros-args -r __node:=debug_node -r __ns:=/yolo --params-file /tmp/launch_params_1_2310_r -r image_raw:=/camera/rgb/image_raw -r detections:=tracking'].

mgonzs13 commented 3 months ago

This problem may be produced by the ROS 2 distro, Foxy, which has reached its EOL. You can use an old version of yolov8_ros compatible with Foxy, like 2.2.2. I hope this can help you.