Open fatemeh-mohseni-AI opened 4 months ago
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.
Hi @fatemeh-mohseni-AI, how you try it in Foxy?
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
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 .
another error occurred :
source /opt/ros/foxy/setup.bash
No module named 'rclpy.lifecycle'
Yeah, Python lifecycle is only available from Humble. A foxy branch can be created to remove them.
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
You can clone the humble rclpy in your docker to include the lifecycle or you can edit yolov8_ros to replace lifecycle with nodes.
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
I had a question about the version of ROS2 which is compatible with this repository. can I use foxy and humble for example ? doesn't matter which version is installed?