Last active
March 7, 2020 03:51
-
-
Save atinfinity/4f683658879e4132b82aa4cb59970a15 to your computer and use it in GitHub Desktop.
LGSVL Simulator & ROS Melodic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nvidia/cudagl:10.0-devel-ubuntu18.04 | |
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all} | |
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics | |
# add new sudo user | |
ENV USERNAME lgsvl | |
ENV HOME /home/$USERNAME | |
RUN useradd -m $USERNAME && \ | |
echo "$USERNAME:$USERNAME" | chpasswd && \ | |
usermod --shell /bin/bash $USERNAME && \ | |
usermod -aG sudo $USERNAME && \ | |
mkdir /etc/sudoers.d && \ | |
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \ | |
chmod 0440 /etc/sudoers.d/$USERNAME && \ | |
# Replace 1000 with your user/group id | |
usermod --uid 1000 $USERNAME && \ | |
groupmod --gid 1000 $USERNAME | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
sudo \ | |
less \ | |
emacs \ | |
tmux \ | |
bash-completion \ | |
command-not-found \ | |
software-properties-common \ | |
xsel \ | |
unzip \ | |
xdg-user-dirs \ | |
libgtk2.0-0 \ | |
wget \ | |
chromium-browser \ | |
&& \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - | |
RUN wget -qO /etc/apt/sources.list.d/lunarg-vulkan-bionic.list http://packages.lunarg.com/vulkan/lunarg-vulkan-bionic.list | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
vulkan-sdk \ | |
&& \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
ADD "https://gitlab.com/nvidia/container-images/vulkan/-/raw/ubuntu18.04/nvidia_icd.json" /usr/share/vulkan/icd.d/nvidia_icd.json | |
RUN chmod 644 /usr/share/vulkan/icd.d/nvidia_icd.json | |
# ROS Melodic | |
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' | |
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
ros-melodic-desktop-full \ | |
python-rosinstall \ | |
python-rosinstall-generator \ | |
python-wstool \ | |
build-essential \ | |
&& \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
ros-melodic-rosbridge-server \ | |
ros-melodic-nmea-msgs \ | |
&& \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN rosdep init | |
USER $USERNAME | |
WORKDIR /home/$USERNAME | |
COPY lgsvlsimulator-linux64-2020.01.zip /home/$USERNAME/ | |
RUN unzip lgsvlsimulator-linux64-2020.01.zip && \ | |
rm /home/$USERNAME/lgsvlsimulator-linux64-2020.01.zip | |
RUN rosdep update | |
RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
XSOCK=/tmp/.X11-unix | |
XAUTH=/tmp/.docker.xauth | |
touch $XAUTH | |
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge - | |
docker run --runtime=nvidia --privileged --rm -it \ | |
--volume=$XSOCK:$XSOCK:rw \ | |
--volume=$XAUTH:$XAUTH:rw \ | |
--volume=$HOME:$HOME \ | |
--shm-size=1gb \ | |
--env="XAUTHORITY=${XAUTH}" \ | |
--env="DISPLAY=${DISPLAY}" \ | |
--env=TERM=xterm-256color \ | |
--env=QT_X11_NO_MITSHM=1 \ | |
--net=host \ | |
lgsvl:melodic \ | |
bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
依存ソフトウェア
前準備
https://www.lgsvlsimulator.com/ から
lgsvlsimulator-linux64-2020.01.zip
をダウンロードしてDockerfileと同じ階層に置きます.Dockerイメージ作成
Dockerコンテナ起動
LGSVL Simulator起動
を実行してLGSVL Simulatorを起動します
Web UI
ROS Bridge
を実行してROS Bridgeを起動します(現状の設定だと
autoware_msgs
は購読できません).その後,Rvizなどでセンサデータを確認できます.