ultralytics_ros icon indicating copy to clipboard operation
ultralytics_ros copied to clipboard

Can this ROS package be run under ROS1 (ROS melodic)?

Open miao202 opened this issue 1 year ago • 4 comments

Can this ROS package be run under ROS1 (ROS melodic)? Since ROS melodic depends on python 2.7, but yolov8 has python >= 3.8, I use $ roslaunch ultralytics_ros tracker.launch debug:=true and get ModuleNotFoundError: No module named 'ultralytics'. Is it possible to run this project under ROS melodic and if so what should I do?

miao202 avatar Jan 05 '24 12:01 miao202

Thank you @miao202, for asking your question.

My package melodic-devel is compatible with ROS melodic, and you can try pipenv to solve compatibility issues with Python versions.

If you need further help, please reopen this issue at any time. Thank you.

Alpaca-zip avatar Jan 05 '24 15:01 Alpaca-zip

Thanks for the answer. Since I used python 3.8 to run roslaunch, I also downloaded all the dependencies in python. When I run roslaunch ultralytics_ros tracker.launch debug:=true, I get the error ModuleNotFoundError: No module named 'ultralytics'. So I'm very confused about it.

---- Replied Message ---- | From | @.> | | Date | 01/05/2024 23:19 | | To | Alpaca-zip/ultralytics_ros @.> | | Cc | miao202 @.>, Mention @.> | | Subject | Re: [Alpaca-zip/ultralytics_ros] Can this ROS package be run under ROS1 (ROS melodic)? (Issue #43) |

Thank you @miao202, for asking your question.

My package melodic-devel is compatible with ROS melodic, and you can try pipenv to solve compatibility issues with Python versions.

If you need further help, please reopen this issue at any time. Thank you.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

miao202 avatar Jan 05 '24 15:01 miao202

Dear @miao202 ,

Previously, I recommended directly installing Python 3.8 on Ubuntu-18.04, but I no longer advise this as it might disrupt dependencies of other packages built for melodic. For information that might be useful to you, please check the old README at the following link: https://github.com/Alpaca-zip/ultralytics_ros/blob/f501ef66cd880a8c2afa35285662e200ec974bc1/README.md

Additionally, please be aware that the noetic-devel branch is not compatible with the melodic environment. In noetic-devel, Python scripts use cv_bridge, which is built for Python 2 in melodic. Consequently, it does not function correctly when running ROS with Python 3.

Also, as I remember, the track() function used in noetic-devel does not work in the melodic environment. https://github.com/Alpaca-zip/ultralytics_ros/blob/bd5c2ceb84a66ca50303ee7e730e2edfedcf2e72/script/tracker_node.py#L51-L61

Best regards,

Alpaca-zip avatar Jan 06 '24 06:01 Alpaca-zip

Dear @miao202 ,

Have the following commands been completed properly?

$ python3 -m pip install -r ultralytics_ros/requirements.txt

If ultralytics_ros has been installed correctly, you should see the following:

$ python3 -m pip list
Package                       Version
----------------------------- --------------------
...
ultralytics                   ****
...

Alpaca-zip avatar Jan 08 '24 14:01 Alpaca-zip