diff --git a/ROS2/AMD64x86/humble_cuda/aptPkgs.list b/ROS2/AMD64x86/humble_cuda/aptPkgs.list index d7c24d2..5ebafd9 100644 --- a/ROS2/AMD64x86/humble_cuda/aptPkgs.list +++ b/ROS2/AMD64x86/humble_cuda/aptPkgs.list @@ -27,4 +27,5 @@ tzdata v4l-utils vim wget -xterm \ No newline at end of file +xterm +libeigen3-dev \ No newline at end of file diff --git a/ROS2/AMD64x86/wheelchair2_base_cuda/Dockerfile b/ROS2/AMD64x86/wheelchair2_base_cuda/Dockerfile index 055e175..ae1fdfe 100644 --- a/ROS2/AMD64x86/wheelchair2_base_cuda/Dockerfile +++ b/ROS2/AMD64x86/wheelchair2_base_cuda/Dockerfile @@ -31,6 +31,7 @@ RUN cd Livox-SDK2 \ && cmake .. && make -j \ && sudo make install -j4 + COPY rosPkgs.list /tmp/rosPkgs.list RUN sudo apt-get update \ && sudo apt-get -y install --no-install-recommends $(cat /tmp/rosPkgs.list) \ @@ -41,6 +42,16 @@ RUN sudo apt-get update \ && pip3 install $(cat /tmp/pythonPkgs.list) \ && sudo rm -rf /var/lib/apt/lists/* +# 3D-BBS +WORKDIR /home/container_user +RUN git clone https://github.com/KOKIAOKI/3d_bbs.git --recursive --depth 1 +RUN cd 3d_bbs \ + && mkdir build && cd build \ + && cmake .. -DCMAKE_BUILD_TYPE=Release && make -j \ + && sudo make install \ + && cd /home/container_user \ + && rm -rf 3d_bbs + #Install Miniconda # RUN mkdir -p ~/miniconda3 && \ # wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \ diff --git a/ROS2/Jetson/humble_jetson/Dockerfile b/ROS2/Jetson/humble_jetson/Dockerfile index 3e396af..70f20d9 100644 --- a/ROS2/Jetson/humble_jetson/Dockerfile +++ b/ROS2/Jetson/humble_jetson/Dockerfile @@ -3,7 +3,7 @@ FROM nvcr.io/nvidia/l4t-jetpack:r36.2.0 # basic args ARG ROS_DISTRO=humble ARG USERNAME=container_user -ARG USER_UID=1000 +ARG USER_UID=1002 ARG USER_GID=$USER_UID # Add metadata labels @@ -53,18 +53,43 @@ RUN apt-get update && apt-get install -q -y --no-install-recommends \ ros-$ROS_DISTRO-desktop \ && rm -rf /var/lib/apt/lists/* -# Create non root user with sudo privilege -RUN groupadd --gid $USER_GID $USERNAME \ - && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ - && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ - && chmod 0440 /etc/sudoers.d/$USERNAME -USER $USERNAME +# Perform all root-level system modifications first +USER root + +# 1. Resolve GID conflicts for Jetson hardware groups (video=44, render=104) +RUN EXISTING_RENDER_GROUP=$(getent group 104 | cut -d: -f1) && \ + if [ ! -z "$EXISTING_RENDER_GROUP" ] && [ "$EXISTING_RENDER_GROUP" != "render" ]; then \ + groupmod -g 9904 "$EXISTING_RENDER_GROUP"; \ + fi && \ + groupmod -g 44 video || true && \ + groupmod -g 104 render || true + +# 2. Robust User Creation: Check if name/UID/GID exists before creating +RUN if getent passwd $USERNAME; then \ + usermod -u $USER_UID $USERNAME && \ + groupmod -g $USER_GID $USERNAME || true; \ + else \ + # Evict GID 1002 if it's taken by a system group (like 'nvidia') + EXISTING_VAL_GROUP=$(getent group $USER_GID | cut -d: -f1); \ + if [ ! -z "$EXISTING_VAL_GROUP" ]; then groupmod -g 9992 "$EXISTING_VAL_GROUP"; fi; \ + groupadd --gid $USER_GID $USERNAME && \ + useradd --uid $USER_UID --gid $USER_GID -m $USERNAME; \ + fi && \ + # Grant sudo and hardware access + usermod -aG sudo,video,render,i2c $USERNAME && \ + echo "$USERNAME ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME && \ + chmod 0440 /etc/sudoers.d/$USERNAME # setup entrypoint COPY ./ros_entrypoint.sh / ENTRYPOINT ["/ros_entrypoint.sh"] +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +USER $USERNAME + # bootstrap rosdep RUN sudo rosdep init && \ rosdep update --rosdistro $ROS_DISTRO diff --git a/ROS2/Jetson/humble_jetson/aptPkgs.list b/ROS2/Jetson/humble_jetson/aptPkgs.list index d7c24d2..5ebafd9 100644 --- a/ROS2/Jetson/humble_jetson/aptPkgs.list +++ b/ROS2/Jetson/humble_jetson/aptPkgs.list @@ -27,4 +27,5 @@ tzdata v4l-utils vim wget -xterm \ No newline at end of file +xterm +libeigen3-dev \ No newline at end of file diff --git a/ROS2/Jetson/wheelchair2_base_jetson/Dockerfile b/ROS2/Jetson/wheelchair2_base_jetson/Dockerfile index 0de8e53..f8ff2d2 100644 --- a/ROS2/Jetson/wheelchair2_base_jetson/Dockerfile +++ b/ROS2/Jetson/wheelchair2_base_jetson/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/smart-wheelchair-rrc/humble_jetson:v5.0 +FROM ghcr.io/smart-wheelchair-rrc/humble_jetson:dev5.1.2 ARG USERNAME=container_user @@ -42,6 +42,17 @@ RUN sudo apt-get update \ && pip3 install $(cat /tmp/pythonPkgs.list) \ && sudo rm -rf /var/lib/apt/lists/* + +#3D-BBS +WORKDIR /home/container_user +RUN git clone https://github.com/KOKIAOKI/3d_bbs.git --recursive --depth 1 +RUN cd 3d_bbs \ + && mkdir build && cd build \ + && cmake .. -DCMAKE_BUILD_TYPE=Release && make -j \ + && sudo make install \ + && cd /home/container_user \ + && rm -rf 3d_bbs + #Install Miniconda # RUN mkdir -p ~/miniconda3 && \ # wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \