From a3c26a912a9d26233d040bd71fe5324cd25142fd Mon Sep 17 00:00:00 2001 From: xia0long <316227346@qq.com> Date: Mon, 11 Oct 2021 06:54:47 +0800 Subject: [PATCH] sim: update CARLA to 0.9.12 (#22497) * bump carla * update dockerfile * no need * specify version * some fixups * fix start_carla Co-authored-by: Adeeb Shihadeh --- .dockerignore | 2 -- tools/sim/.gitignore | 4 ---- tools/sim/Dockerfile.sim | 6 +++--- tools/sim/install_carla.sh | 16 ---------------- tools/sim/start_carla.sh | 15 +++++++-------- 5 files changed, 10 insertions(+), 33 deletions(-) delete mode 100644 tools/sim/.gitignore delete mode 100755 tools/sim/install_carla.sh diff --git a/.dockerignore b/.dockerignore index 5f791f3cdd..4a19eb9c3f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -36,5 +36,3 @@ xx/projects !xx/projects/map3d xx/ops xx/junk -tools/sim/carla -tools/sim/*.tar.gz diff --git a/tools/sim/.gitignore b/tools/sim/.gitignore deleted file mode 100644 index b9442630ef..0000000000 --- a/tools/sim/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -CARLA_*.tar.gz -carla -carla_tmp - diff --git a/tools/sim/Dockerfile.sim b/tools/sim/Dockerfile.sim index 06dfaef790..cff02565f1 100644 --- a/tools/sim/Dockerfile.sim +++ b/tools/sim/Dockerfile.sim @@ -36,9 +36,9 @@ ENV QTWEBENGINE_DISABLE_SANDBOX 1 RUN dbus-uuidgen > /etc/machine-id -# CARLA python api -COPY ./tools/sim/install_carla.sh /tmp -RUN /tmp/install_carla.sh +# Install CARLA python api +RUN pip install --upgrade pip && \ + pip install --no-cache-dir carla==0.9.12 # get same tmux config used on NEOS for debugging RUN cd $HOME && \ diff --git a/tools/sim/install_carla.sh b/tools/sim/install_carla.sh deleted file mode 100755 index 27d2d4662f..0000000000 --- a/tools/sim/install_carla.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -cd /tmp -FILE=CARLA_0.9.11.tar.gz -rm -f $FILE -curl -O https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/$FILE - -rm -rf carla_tmp -mkdir -p carla_tmp -cd carla_tmp -tar xvf ../$FILE PythonAPI/ -easy_install PythonAPI/carla/dist/carla-0.9.11-py3.7-linux-x86_64.egg || true - -cd .. -rm -rf /tmp/$FILE -rm -rf carla_tmp diff --git a/tools/sim/start_carla.sh b/tools/sim/start_carla.sh index 3e54155c9c..df6e2a3fa3 100755 --- a/tools/sim/start_carla.sh +++ b/tools/sim/start_carla.sh @@ -1,6 +1,6 @@ #!/bin/bash -#Requires nvidia docker - https://github.com/NVIDIA/nvidia-docker +# Requires nvidia docker - https://github.com/NVIDIA/nvidia-docker if ! $(apt list --installed | grep -q nvidia-container-toolkit); then if [ -z "$INSTALL" ]; then echo "Nvidia docker is required. Re-run with INSTALL=1 to automatically install." @@ -15,14 +15,13 @@ if ! $(apt list --installed | grep -q nvidia-container-toolkit); then fi fi -docker pull carlasim/carla:0.9.11 +docker pull carlasim/carla:0.9.12 docker run \ --rm \ - --net=host \ - -e DISPLAY= \ - -e SDL_VIDEODRIVER=offscreen \ - -it \ --gpus all \ - carlasim/carla:0.9.11 \ - ./CarlaUE4.sh -opengl -nosound -quality-level=Epic + --net=host \ + -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ + -it \ + carlasim/carla:0.9.12 \ + /bin/bash ./CarlaUE4.sh -opengl -nosound -RenderOffScreen -quality-level=Epic