Compare commits

...

3 commits

Author SHA1 Message Date
1babceecdb fixed errenous jazzy references 2024-06-05 12:25:56 +02:00
191bb48254 fixed wrong libraries 2024-06-05 12:14:19 +02:00
b73e90ca0f update 2024-06-05 12:12:29 +02:00
4 changed files with 43 additions and 15 deletions

View file

@ -3,6 +3,8 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \ RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
&& apt-get install -y \ && apt-get install -y \
gdb \
gdbserver \
ripgrep \ ripgrep \
ninja-build \ ninja-build \
gettext \ gettext \
@ -30,17 +32,17 @@ RUN apt-get update \
FROM base-ros-nvim AS base-ros-nvim-graphics FROM base-ros-nvim AS base-ros-nvim-graphics
ARG ROS_DISTR=iron ARG ROS_DISTR=iron
ENV ROS_DISTR=$ROS_DISTR
ENV NVIDIA_VISIBLE_DEVICES \ ENV NVIDIA_VISIBLE_DEVICES \
${NVIDIA_VISIBLE_DEVICES:-all} ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES \ ENV NVIDIA_DRIVER_CAPABILITIES \
${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
ENV ROS_DISTR=$ROS_DISTR
RUN apt-get update \ RUN apt-get update \
#&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ #&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
&& apt-get install -y \ && apt-get install -y \
software-properties-common \ software-properties-common \
&& add-apt-repository -y ppa:inivation-ppa/inivation \ #&& add-apt-repository -y ppa:inivation-ppa/inivation \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN apt-get update \ RUN apt-get update \
@ -48,6 +50,7 @@ RUN apt-get update \
&& apt-get install -y \ && apt-get install -y \
libgl1-mesa-dri \ libgl1-mesa-dri \
libgl1-mesa-glx \ libgl1-mesa-glx \
# libglx-mesa0 \
mesa-utils \ mesa-utils \
mesa-utils-extra \ mesa-utils-extra \
python3-pip \ python3-pip \
@ -58,14 +61,20 @@ RUN apt-get update \
iputils-ping \ iputils-ping \
sudo \ sudo \
wget \ wget \
#dv-processing \
#dv-runtime-dev \
libserial-dev \ libserial-dev \
nlohmann-json3-dev \
ros-${ROS_DISTR}-rqt-tf-tree \ ros-${ROS_DISTR}-rqt-tf-tree \
ros-${ROS_DISTR}-apriltag \ ros-${ROS_DISTR}-apriltag \
ros-${ROS_DISTR}-plotjuggler-ros \ ros-${ROS_DISTR}-plotjuggler-ros \
ros-${ROS_DISTR}-tf-transformations \ ros-${ROS_DISTR}-tf-transformations \
ros-${ROS_DISTR}-topic-tools \ ros-${ROS_DISTR}-topic-tools \
ros-${ROS_DISTR}-rviz-2d-overlay-plugins \ ros-${ROS_DISTR}-rviz-2d-overlay-plugins \
&& pip3 install transforms3d \ ros-${ROS_DISTR}-simple-launch \
ros-${ROS_DISTR}-slider-publisher \
pre-commit \
# && pip3 install transforms3d \
# && rosdep install --from-paths /ros2_underlay/src -y --ignore-src \ # && rosdep install --from-paths /ros2_underlay/src -y --ignore-src \
# && rosdep install --from paths /ros2/src -y --ignore-src \ # && rosdep install --from paths /ros2/src -y --ignore-src \
&& apt-get autoremove -y \ && apt-get autoremove -y \
@ -77,7 +86,8 @@ ARG USERNAME=ros-user
ARG USER_UID=1000 ARG USER_UID=1000
ARG USER_GID=$USER_UID ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \ RUN userdel -r ubuntu; \
groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
&& chmod 0440 /etc/sudoers.d/$USERNAME && chmod 0440 /etc/sudoers.d/$USERNAME
@ -104,9 +114,14 @@ RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/
&& mkdir -p "$HOME/.zsh" \ && mkdir -p "$HOME/.zsh" \
&& git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure" \ && git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure" \
&& echo "source /opt/ros/$ROS_DISTR/setup.zsh" >> /home/$USERNAME/.zshrc \ && echo "source /opt/ros/$ROS_DISTR/setup.zsh" >> /home/$USERNAME/.zshrc \
&& pip3 install yapf pre-commit ruff \ # && pip3 install yapf pre-commit ruff \
&& git clone https://github.com/HippoCampusRobotics/hippo_core.git "$HOME/hippo_core" \
&& ls $HOME/hippo_core/hippo_common/scripts \
&& $HOME/hippo_core/hippo_common/scripts/install_scripts.sh \
&& sudo wget https://hippocampusrobotics.github.io/docs/_downloads/6055b3168d4f0a8cd764ebc481280219/ros-iron-px4-msgs_2.0.1-0jammy_amd64.deb \ && sudo wget https://hippocampusrobotics.github.io/docs/_downloads/6055b3168d4f0a8cd764ebc481280219/ros-iron-px4-msgs_2.0.1-0jammy_amd64.deb \
&& sudo apt-get install ./ros-iron-px4-msgs_2.0.1-0jammy_amd64.deb \ # && sudo wget https://hippocampusrobotics.github.io/docs/_downloads/286cb880b68d2c4b6c6d9e6730fab199/ros-jazzy-px4-msgs_2.0.1-0noble_amd64.deb \
# && sudo apt-get install ./ros-${ROS_DISTR}-px4-msgs_2.0.1-0noble_amd64.deb \
&& sudo apt-get install ./ros-${ROS_DISTR}-px4-msgs_2.0.1-0jammy_amd64.deb \
&& sudo apt install asciinema \ && sudo apt install asciinema \
&& sudo apt-get autoremove -y \ && sudo apt-get autoremove -y \
&& sudo apt-get clean -y \ && sudo apt-get clean -y \
@ -116,8 +131,10 @@ USER root
RUN mkdir /zsh_history \ RUN mkdir /zsh_history \
&& touch /zsh_history/.zsh_history \ && touch /zsh_history/.zsh_history \
&& chown -R $USERNAME /zsh_history && chown -R $USERNAME /zsh_history
RUN mkdir /home/$USERNAME/.cache/pre-commit \ RUN mkdir -p /home/$USERNAME/.cache/pre-commit \
&& chown -R $USERNAME /home/$USERNAME/.cache/pre-commit && chown -R $USERNAME /home/$USERNAME/.cache/pre-commit
RUN mkdir -p /home/$USERNAME/.local/bin \
&& chown -R $USERNAME /home/$USERNAME/.local/bin
ADD ros2-vim/nvim /home/$USERNAME/.config/nvim ADD ros2-vim/nvim /home/$USERNAME/.config/nvim
RUN chown -R $USERNAME /home/$USERNAME/ RUN chown -R $USERNAME /home/$USERNAME/
USER ${USERNAME} USER ${USERNAME}

1
build
View file

@ -1,3 +1,4 @@
#!/usr/bin/bash #!/usr/bin/bash
docker pull osrf/ros:iron-desktop-full
docker compose build --pull docker compose build --pull

View file

@ -46,7 +46,7 @@ services:
target: /home/ros-user/.config/nvim target: /home/ros-user/.config/nvim
- type: bind - type: bind
source: $XDG_RUNTIME_DIR/${WAYLAND_DISPLAY} source: $XDG_RUNTIME_DIR/${WAYLAND_DISPLAY}
target: /tmp/${WAYLAND_DISPLAY} target: /tmp/runtime-ros-user/${WAYLAND_DISPLAY}
- "ros2_zsh_history:/zsh_history" - "ros2_zsh_history:/zsh_history"
- pre_commit_data:/home/ros-user/.cache/pre-commit - pre_commit_data:/home/ros-user/.cache/pre-commit
- nvim_data:/home/ros-user/.local/share/nvim - nvim_data:/home/ros-user/.local/share/nvim
@ -55,7 +55,7 @@ services:
environment: environment:
- DISPLAY=${DISPLAY} - DISPLAY=${DISPLAY}
- XDG_RUNTIME_DIR=/tmp - XDG_RUNTIME_DIR=/tmp/runtime-ros-user
- WAYLAND_DISPLAY=${WAYLAND_DISPLAY} - WAYLAND_DISPLAY=${WAYLAND_DISPLAY}
- QT_X11_NO_MITSHM=1 - QT_X11_NO_MITSHM=1
- QT_STYLE_OVERRIDE=breeze - QT_STYLE_OVERRIDE=breeze

View file

@ -1,13 +1,18 @@
#!/bin/bash #!/bin/bash
set -e set -e
WORKSPACE_DIR="\$HOME/uuv/ros2"
UNDERLAY_DIR="\$HOME/uuv/ros2_underlay"
#echo "alias build_ros=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source $UNDERLAY_DIR/install/setup.bash && cd $WORKSPACE_DIR && colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON'\"" >> ~/.zshrc host=$(cat /etc/hostname)
#echo "alias build_underlay=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source /opt/ros/$ROS_DISTR/setup.bash && cd $UNDERLAY_DIR && colcon build'\"" >> ~/.zshrc echo "127.0.0.1 $host" | sudo tee -a /etc/hosts > /dev/null 2>1
echo "alias rosdep-ros2=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source \$HOME/uuv/ros2_underlay/install/setup.bash && cd \$HOME/uuv/ros2 && rosdep install --from-paths src -y --ignore-src'\"" >> ~/.zshrc sudo chown $UID:$UID $XDG_RUNTIME_DIR
echo "alias rosdep-underlay=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source /opt/ros/iron/setup.bash && cd \$HOME/uuv/ros2_underlay && rosdep install --from-paths src -y --ignore-src'\"" >> ~/.zshrc chmod 700 $XDG_RUNTIME_DIR
export WORKSPACE_DIR="\$HOME/uuv/ros2"
export UNDERLAY_DIR="\$HOME/uuv/ros2_underlay"
echo "alias build_ros=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source $UNDERLAY_DIR/install/setup.bash && cd $WORKSPACE_DIR && colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON'\"" >> ~/.zshrc
echo "alias build_underlay=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source /opt/ros/$ROS_DISTR/setup.bash && cd $UNDERLAY_DIR && colcon build'\"" >> ~/.zshrc
echo "alias rosdep-ros2=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color UNDERLAY_DIR=\$UNDERLAY_DIR bash -l -c 'source \$UNDERLAY_DIR/install/setup.bash && cd $WORKSPACE_DIR && rosdep install --from-paths src -y --ignore-src'\"" >> ~/.zshrc
echo "alias rosdep-underlay=\"env -i UNDERLAY_DIR=\$UNDERLAY_DIR HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source /opt/ros/$ROS_DISTR/setup.bash && cd $UNDERLAY_DIR && rosdep install --from-paths src -y --ignore-src'\"" >> ~/.zshrc
echo 'source $HOME/uuv/ros2_underlay/install/setup.zsh' >> ~/.zshrc echo 'source $HOME/uuv/ros2_underlay/install/setup.zsh' >> ~/.zshrc
echo 'source $HOME/uuv/ros2/install/local_setup.zsh' >> ~/.zshrc echo 'source $HOME/uuv/ros2/install/local_setup.zsh' >> ~/.zshrc
@ -18,4 +23,9 @@ echo 'eval "$(register-python-argcomplete3 build-ros)"' >> ~/.zshrc
echo 'eval "$(register-python-argcomplete3 clean-ros)"' >> ~/.zshrc echo 'eval "$(register-python-argcomplete3 clean-ros)"' >> ~/.zshrc
echo "bindkey '^ ' autosuggest-toggle" >> ~/.zshrc echo "bindkey '^ ' autosuggest-toggle" >> ~/.zshrc
# required to make the daemon/CLI work properly
# might be fixed in ros jazzy according to https://github.com/ros2/ros2/issues/1531
ulimit -n 1024
exec $@ exec $@