Skip to content

Commit 0e2b5cd

Browse files
authored
Merge pull request #55 from Ar-Ray-code/feat/jazzy
support ubuntu24 (but there is not tested)
2 parents 612f82f + ab58ecd commit 0e2b5cd

File tree

13 files changed

+93
-125
lines changed

13 files changed

+93
-125
lines changed

yolox_ros_cpp/README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Requirements
44
- ROS2 Iron
5-
- ros-iron-generate-parameter-library
6-
- ros-iron-vision-msgs
7-
- ros-iron-usb-cam
5+
- ros-jazzy-generate-parameter-library
6+
- ros-jazzy-vision-msgs
7+
- ros-jazzy-usb-cam
88
- OpenCV 4.x
99
- OpenVINO 2024.*
1010
- TensorRT 10.x *
@@ -23,7 +23,7 @@
2323
## Clone YOLOX-ROS
2424
```bash
2525
cd ~/ros2_ws/src
26-
git clone --recursive https://github.com/Ar-Ray-code/YOLOX-ROS -b iron
26+
git clone --recursive https://github.com/Ar-Ray-code/YOLOX-ROS -b jazzy
2727
```
2828

2929
## Model Convert or Download
@@ -75,16 +75,15 @@ cd ~/ros2_ws
7575

7676
```bash
7777
# build with openvino
78-
source /opt/ros/humble/setup.bash
79-
source /opt/intel/openvino_2021/bin/setupvars.sh
78+
source /opt/ros/jazzy/setup.bash
8079
colcon build --symlink-install --cmake-args -DYOLOX_USE_OPENVINO=ON
8180
```
8281

8382
### TensorRT
8483

8584
```bash
8685
# build with tensorrt
87-
source /opt/ros/iron/setup.bash
86+
source /opt/ros/jazzy/setup.bash
8887
colcon build --symlink-install --cmake-args -DYOLOX_USE_TENSORRT=ON
8988
```
9089

@@ -95,7 +94,7 @@ colcon build --symlink-install --cmake-args -DYOLOX_USE_TENSORRT=ON
9594
https://www.tensorflow.org/lite/guide/build_cmake
9695

9796
Below is an example build script.
98-
Please change `${WORKSPACE}` as appropriate for your environment.
97+
Please change `${WORKSPACE}` as appropriate for your envjazzyment.
9998
```bash
10099
export WORKSPACE=${HOME}/ws_tflite
101100
mkdir -p ${WORKSPACE}

yolox_ros_cpp/docker/onnxruntime/docker-compose.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@ services:
55
build:
66
context: .
77
args:
8-
- BASE_TAB=12.1.0-cudnn8-devel-ubuntu22.04
9-
image: fateshelled/onnxruntime_yolox_ros:latest
8+
- BASE_TAB=12.6.1-cudnn-devel-ubuntu24.04
109
network_mode: host
11-
runtime: nvidia
10+
deploy:
11+
resources:
12+
reservations:
13+
devices:
14+
- driver: nvidia
15+
count: 1
16+
capabilities: [gpu]
17+
1218
environment:
1319
- DISPLAY=$DISPLAY
20+
- NVIDIA_DISABLE_REQUIRE=1
1421
volumes:
1522
- $HOME/ros2_ws:/root/ros2_ws
1623
- /tmp/.X11-unix:/tmp/.X11-unix
17-
devices:
18-
- "/dev/video0:/dev/video0"
24+
# devices:
25+
# - "/dev/video0:/dev/video0"
1926
working_dir: /root/ros2_ws
2027
tty: true
2128
command: bash
Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,46 @@
1-
ARG BASE_TAG=11.7.1-cudnn8-devel-ubuntu22.04
2-
FROM nvcr.io/nvidia/cuda:${BASE_TAG}
3-
ENV DEBIAN_FRONTEND=noninteractive
1+
ARG BASE_TAG=12.6.1-cudnn-devel-ubuntu24.04
2+
FROM nvidia/cuda:${BASE_TAG}
3+
4+
ENV TZ=Asia/Tokyo
5+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
6+
ENV DEBIAN_FRONTEND=noninteractive
47

58
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
6-
RUN apt update && \
7-
apt install -y python3-dev python3-pip \
8-
ca-certificates g++ gcc make git aria2 && \
9+
10+
RUN apt update && apt install -y locales git cmake wget curl gnupg2 lsb-release python3-numpy python3-setuptools python3-wheel && \
11+
locale-gen en_US en_US.UTF-8 && \
12+
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
913
apt -y clean && \
10-
rm -rf /var/lib/apt/lists/* && \
11-
aria2c -q -d /tmp -o cmake-3.21.0-linux-x86_64.tar.gz https://github.com/Kitware/CMake/releases/download/v3.21.0/cmake-3.21.0-linux-x86_64.tar.gz && \
12-
tar -zxf /tmp/cmake-3.21.0-linux-x86_64.tar.gz --strip=1 -C /usr
13-
RUN python3 -m pip install -U pip && \
14-
python3 -m pip install -U numpy setuptools wheel && \
15-
python3 -m pip cache purge
14+
rm -rf /var/lib/apt/lists/*
15+
ENV LANG=en_US.UTF-8
1616

17-
WORKDIR /workdir
18-
RUN git clone --depth 1 --recursive https://github.com/microsoft/onnxruntime -b v1.12.1 && \
17+
RUN git clone --depth 1 --recursive https://github.com/microsoft/onnxruntime -b v1.19.2 && \
1918
cd onnxruntime && \
2019
./build.sh --cudnn_home /usr/lib/x86_64-linux-gnu/ \
2120
--cuda_home /usr/local/cuda \
2221
--use_cuda \
2322
--config RelWithDebInfo \
2423
--build_shared_lib \
24+
--allow_running_as_root \
2525
--skip_tests && \
2626
cd build/Linux/RelWithDebInfo && \
27-
make install && \
28-
rm -r /workdir/onnxruntime
29-
30-
# Install ROS2
31-
RUN apt update && apt install locales && \
32-
locale-gen en_US en_US.UTF-8 && \
33-
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
34-
apt -y clean && \
35-
rm -rf /var/lib/apt/lists/*
36-
ENV LANG=en_US.UTF-8
27+
make install
3728

38-
RUN apt update && \
39-
apt install -y git wget curl gnupg2 lsb-release && \
40-
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
29+
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
4130
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
42-
sed -i -e 's/ubuntu .* main/ubuntu jammy main/g' /etc/apt/sources.list.d/ros2.list && \
31+
sed -i -e 's/ubuntu .* main/ubuntu noble main/g' /etc/apt/sources.list.d/ros2.list && \
4332
apt update && \
4433
apt install -y ros-dev-tools \
45-
ros-humble-cv-bridge \
46-
ros-humble-generate-parameter-library \
47-
ros-humble-parameter-traits \
48-
ros-humble-ros-base \
49-
ros-humble-rqt-image-view \
50-
ros-humble-v4l2-camera && \
34+
ros-jazzy-cv-bridge \
35+
ros-jazzy-generate-parameter-library \
36+
ros-jazzy-parameter-traits \
37+
ros-jazzy-ros-base \
38+
ros-jazzy-rqt-image-view \
39+
ros-jazzy-usb-cam \
40+
ros-jazzy-vision-msgs && \
5141
apt -y clean && \
52-
rm -rf /var/lib/apt/lists/* && \
53-
pip install -U pip && \
54-
pip install catkin_pkg && \
55-
pip install empy && \
56-
pip install lark && \
57-
python3 -m pip cache purge
58-
42+
rm -rf /var/lib/apt/lists/*
5943

44+
WORKDIR /workspace
6045
COPY ./ros_entrypoint.sh /ros_entrypoint.sh
6146
RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc
62-
# ENTRYPOINT ["/ros_entrypoint.sh"]
63-
CMD ["bash"]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/bin/bash
2-
source /opt/ros/humble/setup.bash
3-
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash
2+
source /opt/ros/jazzy/setup.bash

yolox_ros_cpp/docker/openvino/docker-compose.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ services:
88
environment:
99
- DISPLAY=$DISPLAY
1010
volumes:
11-
- ../../../:/root/ros2_ws/src
11+
- $HOME/ros2_ws:/root/ros2_ws
1212
- /tmp/.X11-unix:/tmp/.X11-unix
13-
devices:
14-
- "/dev/video0:/dev/video0"
13+
# devices:
14+
# - "/dev/video0:/dev/video0"
1515
working_dir: /root/ros2_ws
1616
tty: true
1717
command: bash
18-
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.04
22

33
ENV TZ=Asia/Tokyo
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
@@ -16,30 +16,27 @@ ENV LANG=en_US.UTF-8
1616
RUN apt update && \
1717
apt install -y git wget curl gnupg2 lsb-release
1818

19-
# ROS
2019
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
2120
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
22-
sed -i -e 's/ubuntu .* main/ubuntu jammy main/g' /etc/apt/sources.list.d/ros2.list
21+
sed -i -e 's/ubuntu .* main/ubuntu noble main/g' /etc/apt/sources.list.d/ros2.list
2322
# INTEL OPENVINO
2423
RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
2524
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
26-
echo "deb https://apt.repos.intel.com/openvino/2024 ubuntu22 main" | tee /etc/apt/sources.list.d/intel-openvino-2024.list
25+
echo "deb https://apt.repos.intel.com/openvino/2024 ubuntu24 main" | tee /etc/apt/sources.list.d/intel-openvino-2024.list
2726

28-
# install ros and openvino
2927
RUN apt update && \
3028
apt install -y openvino-2024.2.0 \
3129
ros-dev-tools \
32-
ros-humble-cv-bridge \
33-
ros-humble-generate-parameter-library \
34-
ros-humble-parameter-traits \
35-
ros-humble-ros-base \
36-
ros-humble-rqt-image-view \
37-
ros-humble-v4l2-camera && \
30+
ros-jazzy-cv-bridge \
31+
ros-jazzy-generate-parameter-library \
32+
ros-jazzy-parameter-traits \
33+
ros-jazzy-ros-base \
34+
ros-jazzy-rqt-image-view \
35+
ros-jazzy-usb-cam \
36+
ros-jazzy-vision-msgs && \
3837
apt -y clean && \
3938
rm -rf /var/lib/apt/lists/*
4039

4140
WORKDIR /workspace
4241
COPY ./ros_entrypoint.sh /ros_entrypoint.sh
4342
RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc
44-
# RUN echo "source /opt/intel/openvino/bin/setupvars.sh " >> /root/.bashrc
45-
CMD ["bash"]
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
#!/bin/bash
2-
source /opt/ros/humble/setup.bash
3-
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash
4-
2+
source /opt/ros/jazzy/setup.bash

yolox_ros_cpp/docker/tensorrt/docker-compose.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@ services:
55
build:
66
context: .
77
args:
8-
- TENSORRT_VERSION=10.1
9-
- CUDNN_VERSION=9.2
10-
- PYTHON_VERSION=3.10
8+
- TENSORRT_VERSION=12.6
9+
- PYTHON_VERSION=3.12
1110
network_mode: host
12-
runtime: nvidia
11+
deploy:
12+
resources:
13+
reservations:
14+
devices:
15+
- driver: nvidia
16+
count: 1
17+
capabilities: [gpu]
1318
environment:
1419
- DISPLAY=$DISPLAY
20+
- NVIDIA_DISABLE_REQUIRE=1
1521
volumes:
1622
- $HOME/ros2_ws:/root/ros2_ws
1723
- /tmp/.X11-unix:/tmp/.X11-unix
18-
devices:
19-
- "/dev/video0:/dev/video0"
24+
# devices:
25+
# - "/dev/video0:/dev/video0"
2026
working_dir: /root/ros2_ws
2127
tty: true
2228
command: bash
Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# pytorch/TensorRT/docker/Dockerfile
22
# Base image starts with CUDA
3-
ARG BASE_IMG=nvidia/cuda:12.4.1-devel-ubuntu22.04
3+
ARG BASE_IMG=nvidia/cuda:12.6.1-devel-ubuntu24.04
44
FROM ${BASE_IMG} as base
5-
ENV BASE_IMG=nvidia/cuda:12.4.1-devel-ubuntu22.04
5+
ENV BASE_IMG=nvidia/cuda:12.6.1-devel-ubuntu24.04
66

77
ARG TENSORRT_VERSION
88
ENV TENSORRT_VERSION=${TENSORRT_VERSION}
@@ -17,28 +17,14 @@ ENV DEBIAN_FRONTEND=noninteractive
1717

1818
# Install basic dependencies
1919
RUN apt-get update
20-
RUN apt install -y build-essential manpages-dev wget zlib1g software-properties-common git libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget ca-certificates curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev mecab-ipadic-utf8
21-
22-
# Install PyEnv and desired Python version
23-
ENV HOME="/root"
24-
ENV PYENV_DIR="$HOME/.pyenv"
25-
ENV PATH="$PYENV_DIR/shims:$PYENV_DIR/bin:$PATH"
26-
RUN wget -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer &&\
27-
chmod 755 pyenv-installer &&\
28-
bash pyenv-installer &&\
29-
eval "$(pyenv init -)"
30-
31-
RUN pyenv install -v ${PYTHON_VERSION}
32-
RUN pyenv global ${PYTHON_VERSION}
20+
RUN apt install -y build-essential manpages-dev wget zlib1g software-properties-common git libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev ca-certificates curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev mecab-ipadic-utf8
3321

3422
# Install TensorRT + dependencies
35-
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub
36-
RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /"
23+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/3bf863cc.pub
24+
RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/ /"
3725
RUN apt-get update
3826
RUN TENSORRT_MAJOR_VERSION=`echo ${TENSORRT_VERSION} | cut -d '.' -f 1` && apt-get install -y tensorrt
3927

40-
ENV DEBIAN_FRONTEND=noninteractive
41-
4228
RUN apt update && apt install locales && \
4329
locale-gen en_US en_US.UTF-8 && \
4430
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
@@ -47,27 +33,22 @@ RUN apt update && apt install locales && \
4733
ENV LANG=en_US.UTF-8
4834

4935
RUN apt update && \
50-
apt install -y git wget curl gnupg2 lsb-release && \
51-
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
36+
apt install -y git wget curl gnupg2 lsb-release
37+
38+
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
5239
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
53-
sed -i -e 's/ubuntu .* main/ubuntu jammy main/g' /etc/apt/sources.list.d/ros2.list && \
40+
sed -i -e 's/ubuntu .* main/ubuntu noble main/g' /etc/apt/sources.list.d/ros2.list && \
5441
apt update && \
5542
apt install -y ros-dev-tools \
56-
ros-humble-cv-bridge \
57-
ros-humble-generate-parameter-library \
58-
ros-humble-parameter-traits \
59-
ros-humble-ros-base \
60-
ros-humble-rqt-image-view \
61-
ros-humble-v4l2-camera && \
43+
ros-jazzy-cv-bridge \
44+
ros-jazzy-generate-parameter-library \
45+
ros-jazzy-parameter-traits \
46+
ros-jazzy-ros-base \
47+
ros-jazzy-rqt-image-view \
48+
ros-jazzy-usb-cam \
49+
ros-jazzy-vision-msgs && \
6250
apt -y clean && \
63-
rm -rf /var/lib/apt/lists/* && \
64-
pip install -U pip && \
65-
pip install catkin_pkg && \
66-
pip install empy==3.3.4 && \
67-
pip install lark && \
68-
python3 -m pip cache purge
51+
rm -rf /var/lib/apt/lists/*
6952

7053
COPY ./ros_entrypoint.sh /ros_entrypoint.sh
7154
RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc
72-
# ENTRYPOINT ["/ros_entrypoint.sh"]
73-
CMD ["bash"]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/bin/bash
2-
source /opt/ros/humble/setup.bash
3-
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash
2+
source /opt/ros/jazzy/setup.bash

0 commit comments

Comments
 (0)