Giter VIP home page Giter VIP logo

Comments (10)

mgonzs13 avatar mgonzs13 commented on July 20, 2024 1

Hey @fatemeh-mohseni-AI, this repository is fully compatible with Humble. I suppose it also works in Foxy since the yolo nodes use the same code as Humble.

from yolov8_ros.

mgonzs13 avatar mgonzs13 commented on July 20, 2024

Hi @fatemeh-mohseni-AI, how you try it in Foxy?

from yolov8_ros.

fatemeh-mohseni-AI avatar fatemeh-mohseni-AI commented on July 20, 2024

hello . sorry for being late .
I tried the installation process on ubuntu 20 desktop + ROS foxy . that was successful , (I just installed the package and didn't run it )
But in dockrizing process there was an error with this content :

173.0 #All required rosdeps installed successfully
173.7 Starting >>> yolov8_ros
175.2 Finished <<< yolov8_ros [1.54s]
175.2 Starting >>> yolov8_msgs
175.8 --- stderr: yolov8_msgs
175.8 CMake Error at CMakeLists.txt:5 (find_package):
175.8 By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
175.8 has asked CMake to find a package configuration file provided by
175.8 "ament_cmake", but CMake did not find one.
175.8
175.8 Could not find a package configuration file provided by "ament_cmake" with
175.8 any of the following names:
175.8
175.8 ament_cmakeConfig.cmake
175.8 ament_cmake-config.cmake
175.8
175.8 Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
175.8 "ament_cmake_DIR" to a directory containing one of the above files. If
175.8 "ament_cmake" provides a separate development package or SDK, be sure it
175.8 has been installed.
175.8
175.8
175.8 ---
175.8 Failed <<< yolov8_msgs [0.64s, exited with code 1]
175.9

And this is the Dockerfile :

FROM --platform=linux/amd64 ros:foxy-ros-base

ENV repo=/root/ros2_ws/src/Ros2_Yolov8
ENV wd=/root/ros2_ws
ENV ROS_DISTRO=foxy

RUN mkdir -p $repo
WORKDIR $wd

COPY . $repo

RUN apt-get update &&  \
    apt-get install -y --no-install-recommends  \
      ros-foxy-ament-cmake python3-pip python3-rosdep ros-foxy-rclpy ros-foxy-sensor-msgs

RUN cd $repo && \
    pip3 install --no-cache-dir -r requirements.txt && \
    pip3 install --no-cache-dir -U rosdep colcon-common-extensions && \
    cd $wd && \
    rosdep update && \
    rosdep install --from-paths src --ignore-src -r -y && \
    colcon build

CMD ["ros2", "launch", "yolov8_bringup", "yolov8.launch.py", "model:=yolov8m-seg.pt"]

also I tried build it on ubuntu 22 , both server and desktop

from yolov8_ros.

fatemeh-mohseni-AI avatar fatemeh-mohseni-AI commented on July 20, 2024

surprisingly I just solved it .
this is the new Dockerfile :

FROM --platform=linux/amd64 ros:foxy-ros-base

ENV repo=/root/ros2_ws/src/Ros2_Yolov8
ENV wd=/root/ros2_ws
ENV ROS_DISTRO=foxy

RUN mkdir -p $repo
WORKDIR $wd

COPY . $repo

RUN apt-get update &&  \
    apt-get install -y --no-install-recommends  \
      ros-foxy-ament-cmake \
      python3-pip \
      python3-rosdep \
      ros-foxy-rclpy \
      ros-foxy-sensor-msgs && \
    rm -rf /var/lib/apt/lists/*

RUN cd $repo && \
    pip3 install --no-cache-dir -r requirements.txt && \
    pip3 install --no-cache-dir -U rosdep colcon-common-extensions

RUN rosdep update && \
    rosdep install --from-paths src --ignore-src -r -y

RUN /bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && colcon build"
CMD ["ros2", "launch", "yolov8_bringup", "yolov8.launch.py", "model:=yolov8m-seg.pt"]

this line was the solution :

/bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash

I have just created the Dockerfile for both amd and arm systems like Jetson families
I can share it if you want .

from yolov8_ros.

fatemeh-mohseni-AI avatar fatemeh-mohseni-AI commented on July 20, 2024

another error occurred :

source /opt/ros/foxy/setup.bash

No module named 'rclpy.lifecycle'

from yolov8_ros.

mgonzs13 avatar mgonzs13 commented on July 20, 2024

Yeah, Python lifecycle is only available from Humble. A foxy branch can be created to remove them.

from yolov8_ros.

fatemeh-mohseni-AI avatar fatemeh-mohseni-AI commented on July 20, 2024

Yeah, Python lifecycle is only available from Humble. A foxy branch can be created to remove them.

So it can not be installed in foxy totally

from yolov8_ros.

mgonzs13 avatar mgonzs13 commented on July 20, 2024

You can clone the humble rclpy in your docker to include the lifecycle or you can edit yolov8_ros to replace lifecycle with nodes.

from yolov8_ros.

richardp4 avatar richardp4 commented on July 20, 2024

Hi,
I got the same problem.
When i launched yolov8_bringup yolov8.launch.py, I got this reply.
My ROS version is foxy not humble., where can i get the rclpy.lifecycle?

$ ros2 launch yolov8_bringup yolov8.launch.py

[yolov8_node-1] File "/home/user/robot_ws/install/yolov8_ros/lib/yolov8_ros/yolov8_node", line 11, in
[yolov8_node-1] load_entry_point('yolov8-ros==0.0.0', 'console_scripts', 'yolov8_node')()
[yolov8_node-1] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point
[yolov8_node-1] return get_distribution(dist).load_entry_point(group, name)
[yolov8_node-1] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point
[yolov8_node-1] return ep.load()
[yolov8_node-1] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load
[yolov8_node-1] return self.resolve()
[yolov8_node-1] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve
[yolov8_node-1] module = import(self.module_name, fromlist=['name'], level=0)
[yolov8_node-1] File "/home/user/robot_ws/install/yolov8_ros/lib/python3.8/site-packages/yolov8_ros/yolov8_node.py", line 24, in
[yolov8_node-1] from rclpy.lifecycle import LifecycleNode
[yolov8_node-1] ModuleNotFoundError: No module named 'rclpy.lifecycle'
[ERROR] [yolov8_node-1]: process has died [pid 55357, exit code 1, cmd '/home/user/robot_ws/install/yolov8_ros/lib/yolov8_ros/yolov8_node --ros-args -r __node:=yolov8_node -r __ns:=/yolo --params-file /tmp/launch_params_830zfy0j -r image_raw:=/camera/rgb/image_raw'].
[tracking_node-2] Traceback (most recent call last):
[tracking_node-2] File "/home/user/robot_ws/install/yolov8_ros/lib/yolov8_ros/tracking_node", line 11, in
[tracking_node-2] load_entry_point('yolov8-ros==0.0.0', 'console_scripts', 'tracking_node')()
[tracking_node-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point
[tracking_node-2] return get_distribution(dist).load_entry_point(group, name)
[tracking_node-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point
[tracking_node-2] return ep.load()
[tracking_node-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load
[tracking_node-2] return self.resolve()
[tracking_node-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve
[tracking_node-2] module = import(self.module_name, fromlist=['name'], level=0)
[tracking_node-2] File "/home/user/robot_ws/install/yolov8_ros/lib/python3.8/site-packages/yolov8_ros/tracking_node.py", line 25, in
[tracking_node-2] from rclpy.lifecycle import LifecycleNode
[tracking_node-2] ModuleNotFoundError: No module named 'rclpy.lifecycle'
[ERROR] [tracking_node-2]: process has died [pid 55359, exit code 1, cmd '/home/user/robot_ws/install/yolov8_ros/lib/yolov8_ros/tracking_node --ros-args -r __node:=tracking_node -r __ns:=/yolo --params-file /tmp/launch_params_nqpq0dp3 -r image_raw:=/camera/rgb/image_raw'].
[debug_node-3] Traceback (most recent call last):
[debug_node-3] File "/home/user/robot_ws/install/yolov8_ros/lib/yolov8_ros/debug_node", line 11, in
[debug_node-3] load_entry_point('yolov8-ros==0.0.0', 'console_scripts', 'debug_node')()
[debug_node-3] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point
[debug_node-3] return get_distribution(dist).load_entry_point(group, name)
[debug_node-3] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point
[debug_node-3] return ep.load()
[debug_node-3] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load
[debug_node-3] return self.resolve()
[debug_node-3] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve
[debug_node-3] module = import(self.module_name, fromlist=['name'], level=0)
[debug_node-3] File "/home/user/robot_ws/install/yolov8_ros/lib/python3.8/site-packages/yolov8_ros/debug_node.py", line 29, in
[debug_node-3] from rclpy.lifecycle import LifecycleNode
[debug_node-3] ModuleNotFoundError: No module named 'rclpy.lifecycle'
[ERROR] [debug_node-3]: process has died [pid 55361, exit code 1, cmd '/home/user/robot_ws/install/yolov8_ros/lib/yolov8_ros/debug_node --ros-args -r __node:=debug_node -r __ns:=/yolo --params-file /tmp/launch_params__emd98zc -r image_raw:=/camera/rgb/image_raw -r detections:=tracking'].

from yolov8_ros.

mgonzs13 avatar mgonzs13 commented on July 20, 2024

For those who want to use lifecycles in Foxy, since it is deprecated, you have to get the updated code from Humble or Rolling. But if you don't want to build al the rclpy, you can use an old version of yolov8_ros that does not use lifecycles, like 2.2.2. I hope this can help you.

from yolov8_ros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.