Skip to content

Commit

Permalink
[Fix] #37 - Fix build process and run for Carla Agent docker image (#56)
Browse files Browse the repository at this point in the history
* Leaderboard and Szenariorunner version changed

* PythonAPI v0.9.14 added to dockerfile

* fix(#37): Fix agent image building

* fix(#37): Updated carla simulator to newest leaderboard-2.0 version

* fix(#37): Fix simulator ALSA warnings and linter errors

* fix: fixed Coordinates in Town 12 and
added new dockerfile for submission.
(Not adjusted yet)

* Remove workaround as its no longer needed after #88

* Remove to have a sperate PR

---------

Co-authored-by: samuelkuehnel <[email protected]>
Co-authored-by: samuelkuehnel <[email protected]>
  • Loading branch information
3 people authored Nov 28, 2023
1 parent 090cbc4 commit 7d1d625
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
7 changes: 5 additions & 2 deletions build/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ version: "3"
services:
flake8:
image: alpine/flake8
command: .
volumes:
- ../:/apps

comlipy:
build: docker/comlipy
command: .
volumes:
- ../:/apps

mdlint:
image: peterdavehello/markdownlint:0.32.2
command: markdownlint .
volumes:
- ../:/md

# based on https://github.com/ll7/paf21-1/blob/master/scenarios/docker-carla-sim-compose.yml
carla-simulator:
command: /bin/bash CarlaUE4.sh -quality-level=Epic -world-port=2000 -resx=800 -resy=600
command: /bin/bash CarlaUE4.sh -quality-level=Epic -world-port=2000 -resx=800 -resy=600 -nosound
# Use this image version to enable instance segmentation cameras: (it does not match the leaderboard version)
# image: carlasim/carla:0.9.14
image: ghcr.io/nylser/carla:leaderboard
image: ghcr.io/una-auxme/paf23:leaderboard-2.0
init: true
expose:
- 2000
Expand Down
14 changes: 6 additions & 8 deletions build/docker/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN apt-get install wget unzip

# Download Carla PythonAPI (alternative to getting it from the Carla-Image, which is commented out above)
# If the PythonAPI/Carla version changes, either update the link, or refer to the comment at the top of this file.
RUN wget https://github.com/nylser/carla-leaderboard-PythonAPI/releases/download/v1.0.0/PythonAPI.zip \
RUN wget https://github.com/una-auxme/paf23/releases/download/v0.0.1/PythonAPI_Leaderboard-2.0.zip -O PythonAPI.zip \
&& unzip PythonAPI.zip \
&& rm PythonAPI.zip \
&& mkdir -p /opt/carla \
Expand Down Expand Up @@ -65,7 +65,7 @@ ENV CUDA_HOME=/usr/local/cuda-11.7

# override python path, carla pip package path didn't exist and was using Python 3.7 instead of 2.7
ENV PYTHONPATH=/opt/ros/noetic/lib/python3/dist-packages
ENV PYTHONPATH=$PYTHONPATH:/opt/carla/PythonAPI/carla/dist/carla-0.9.13-py3.7-linux-x86_64.egg:/opt/carla/PythonAPI/carla
ENV PYTHONPATH=$PYTHONPATH:/opt/carla/PythonAPI/carla/dist/carla-0.9.14-py3.7-linux-x86_64.egg:/opt/carla/PythonAPI/carla

# install mlocate, pip, wget, git and some ROS dependencies for building the CARLA ROS bridge
RUN apt-get update && apt-get install -y \
Expand Down Expand Up @@ -111,27 +111,25 @@ ENV PATH=$PATH:/home/$USERNAME/.local/bin

# install simple_pid
RUN python -m pip install pip --upgrade \
&& python -m pip install simple_pid pygame transformations
&& python -m pip install simple_pid pygame transformations roslibpy lxml

# install the scenario runner from GitHub leaderboard-2.0 branch
ENV CARLA_ROOT=/opt/carla
ENV SCENARIO_RUNNER_ROOT=/opt/scenario_runner
RUN sudo mkdir $SCENARIO_RUNNER_ROOT && sudo chown $USERNAME:$USERNAME $SCENARIO_RUNNER_ROOT
RUN git clone https://github.com/carla-simulator/scenario_runner.git $SCENARIO_RUNNER_ROOT && cd $SCENARIO_RUNNER_ROOT && git checkout 7b5894c8a1d6886405ff5c2126bbf5832b274275 && cd -
RUN git clone -b leaderboard-2.0 --single-branch https://github.com/carla-simulator/scenario_runner.git $SCENARIO_RUNNER_ROOT
RUN echo 'pexpect' >> $SCENARIO_RUNNER_ROOT/requirements.txt && \
python -m pip install -r $SCENARIO_RUNNER_ROOT/requirements.txt

# install the leaderboard from GitHub leaderboard-2.0 branch
ENV LEADERBOARD_ROOT=/opt/leaderboard
RUN sudo mkdir $LEADERBOARD_ROOT && sudo chown $USERNAME:$USERNAME $LEADERBOARD_ROOT
RUN git clone https://github.com/carla-simulator/leaderboard.git $LEADERBOARD_ROOT && cd $LEADERBOARD_ROOT && git checkout 3f27e94446cbd53225715258c710bec9c051c5b7 && cd -
RUN git clone -b leaderboard-2.0 --single-branch https://github.com/carla-simulator/leaderboard.git $LEADERBOARD_ROOT
RUN python -m pip install -r $LEADERBOARD_ROOT/requirements.txt
RUN sudo mkdir /opt/leaderboard-py3 && sudo chown $USERNAME:$USERNAME /opt/leaderboard-py3 && \
ln -s $LEADERBOARD_ROOT/leaderboard /opt/leaderboard-py3/leaderboard && \
ln -s $SCENARIO_RUNNER_ROOT/srunner /opt/leaderboard-py3/srunner

RUN python -m pip install roslibpy lxml

# environment variables for the leaderboard_evaluator
ENV ROUTES=$LEADERBOARD_ROOT/data/routes_devtest.xml
ENV REPETITIONS=1
Expand Down Expand Up @@ -163,7 +161,7 @@ COPY --chown=$USERNAME:$USERNAME ./code/requirements.txt /workspace/
ENV TORCH_CUDA_ARCH_LIST="5.2 6.0 6.1 7.0 7.5 8.0 8.6+PTX"
ENV IABN_FORCE_CUDA=1

RUN source ~/.bashrc && cat /workspace/requirements.txt | xargs -n 1 -L 1 pip install
RUN source ~/.bashrc && pip install -r /workspace/requirements.txt

# Add agent code
COPY --chown=$USERNAME:$USERNAME ./code /workspace/code/
Expand Down
2 changes: 1 addition & 1 deletion code/perception/src/coordinate_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class GeoRef(Enum):
TOWN09 = 0, 0, 0 # lat =, lon =, alt = #Town09/HD not found
TOWN10 = 0, 0, 0 # Town10HD
TOWN11 = 0, 0, 0 # lat =, lon =, alt = #Town11/HD not found
TOWN12 = 35.25000, -101.87500, 331.00000
TOWN12 = 0, 0, 0 # 35.25000, -101.87500, 331.00000


a = 6378137
Expand Down
2 changes: 0 additions & 2 deletions code/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ torchaudio==0.13.1
pytorch-lightning==1.8.5
opencv-python==4.7.0.68
dvclive==1.3.2
torch==1.13.1
torchvision==0.14.1
ruamel.yaml==0.17.21
scipy==1.10.0
xmltodict==0.13.0
Expand Down

0 comments on commit 7d1d625

Please sign in to comment.