diff --git a/build/Taskfile b/build/Taskfile index 9ad466af..b152bc75 100644 --- a/build/Taskfile +++ b/build/Taskfile @@ -11,6 +11,11 @@ task:run() { docker:compose up "$@" } +task:run_dev() { + xhost +local:docker + docker:compose -f docker-compose.dev.yaml up +} + task:restart() { container="$1" docker:compose restart "${container:-agent}" diff --git a/build/docker-compose.dev.yaml b/build/docker-compose.dev.yaml new file mode 100644 index 00000000..6ba17e3d --- /dev/null +++ b/build/docker-compose.dev.yaml @@ -0,0 +1,90 @@ +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 -nosound -carla-settings="/home/carla/CarlaUE4/Config/CustomCarlaSettings.ini" + image: ghcr.io/una-auxme/paf23:leaderboard-2.0 + init: true + deploy: + resources: + limits: + memory: 16G + expose: + - 2000 + - 2001 + - 2002 + environment: + - XDG_RUNTIME_DIR=/tmp/runtime-carla + networks: + - carla + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix + - ./CustomCarlaSettings.ini:/home/carla/CarlaUE4/Config/CustomCarlaSettings.ini + + roscore: + image: ros:noetic + command: roscore + environment: + - ROS_MASTER_URI=http://roscore:11311 + - ROS_HOSTNAME=roscore + expose: + - 11311 + networks: + - ros + + agent: + build: + dockerfile: build/docker/agent/Dockerfile + args: + - USER_UID=${DOCKER_HOST_UNIX_UID:-1000} + - USER_GID=${DOCKER_HOST_UNIX_GID:-1000} + context: ../ + init: true + tty: true + shm_size: 2gb + #command: bash -c "sleep 10 && python3 /opt/leaderboard/leaderboard/leaderboard_evaluator.py --debug=0 --routes=/opt/leaderboard/data/routes_devtest.xml --agent=/opt/leaderboard/leaderboard/autoagents/npc_agent.py --host=carla-simulator --track=SENSORS" + command: bash -c "sleep 10 && roslaunch agent/launch/dev.launch" + # command: bash -c "sleep 10 && sudo chown -R carla:carla ../code/ && sudo chmod -R a+w ../code/ && python3 /opt/leaderboard/leaderboard/leaderboard_evaluator.py --debug=0 --routes=/opt/leaderboard/data/routes_devtest.xml --agent=/workspace/code/agent/src/agent/agent.py --host=paf23-carla-simulator-1 --track=MAP" + + logging: + driver: "local" + environment: + - DISPLAY + - ROS_MASTER_URI=http://roscore:11311 + - CARLA_SIM_HOST=carla-simulator + - ROS_HOSTNAME=agent + - XDG_RUNTIME_DIR=/tmp/runtime-carla + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix + # if you change the volume here also change the copy command + # in ``build/docker/build/Dockerfile + - ../:/workspace + # mount git config for dvc + - ../.gitconfig:/home/carla/.gitconfig + - ../:/workspace/ + networks: + - carla + - ros + +networks: + carla: + ros: diff --git a/build/docker/agent/Dockerfile b/build/docker/agent/Dockerfile index 2c6ce5ac..93b677b3 100644 --- a/build/docker/agent/Dockerfile +++ b/build/docker/agent/Dockerfile @@ -120,7 +120,7 @@ RUN echo 'pexpect' >> $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 -b leaderboard-2.0 --single-branch https://github.com/carla-simulator/leaderboard.git $LEADERBOARD_ROOT +RUN git clone -b leaderboard-2.0 --single-branch https://github.com/una-auxme/leaderboard $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 && \ diff --git a/build/docker/agent/Dockerfile_Submission b/build/docker/agent/Dockerfile_Submission index 17fdcce6..bb6757d2 100644 --- a/build/docker/agent/Dockerfile_Submission +++ b/build/docker/agent/Dockerfile_Submission @@ -122,7 +122,7 @@ RUN echo 'pexpect' >> $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 -b leaderboard-2.0 --single-branch https://github.com/carla-simulator/leaderboard.git $LEADERBOARD_ROOT +RUN git clone -b leaderboard-2.0 --single-branch https://github.com/una-auxme/leaderboard $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 && \ diff --git a/code/agent/config/dev_objects.json b/code/agent/config/dev_objects.json index c1d5e69b..86a88ba3 100644 --- a/code/agent/config/dev_objects.json +++ b/code/agent/config/dev_objects.json @@ -112,7 +112,7 @@ "yaw": 0.0 }, "range": 50, - "rotation_frequency": 15, + "rotation_frequency": 10, "channels": 64, "upper_fov": 10, "lower_fov": -30, diff --git a/code/agent/launch/agent.launch b/code/agent/launch/agent.launch index 089c378a..3edf1f08 100644 --- a/code/agent/launch/agent.launch +++ b/code/agent/launch/agent.launch @@ -1,6 +1,6 @@ - + diff --git a/code/agent/launch/dev.launch b/code/agent/launch/dev.launch index cc1f148d..ddfae533 100644 --- a/code/agent/launch/dev.launch +++ b/code/agent/launch/dev.launch @@ -15,7 +15,7 @@ - +