Set Up the Environment
This page includes preparations before running our project.
Install CARLA
Before doing anything, CARLA must be installed.
mkdir carla
cd carla
wget https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/CARLA_0.9.15.tar.gz
tar -xvf CARLA_0.9.15.tar.gz
cd Import && wget https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/AdditionalMaps_0.9.15.tar.gz
cd .. && bash ImportAssets.sh
export CARLA_ROOT=YOUR_CARLA_PATH
echo "$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.15-py3.7-linux-x86_64.egg" >> YOUR_CONDA_PATH/envs/YOUR_CONDA_ENV_NAME/lib/python3.7/site-packages/carla.pth # python 3.8 also works well, please set YOUR_CONDA_PATH and YOUR_CONDA_ENV_NAME
CARLA issues
CARLA has complex dependencies and is not stable. Please check the issue section of CARLA very carefully.
Configure the environment
After installing CARLA, write an env.sh
:
env.sh
export CARLA_ROOT=/path/to/your/carla
export CARLA_SERVER=${CARLA_ROOT}/CarlaUE4.sh
export PYTHONPATH=${CARLA_ROOT}/PythonAPI
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla
export PYTHONPATH=$PYTHONPATH:$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.15-py3.7-linux-x86_64.egg
export WORK_DIR=/path/to/Bench2Drive-VL/repo
export PYTHONPATH=$PYTHONPATH:${WORK_DIR}/scenario_runner
export PYTHONPATH=$PYTHONPATH:${WORK_DIR}/leaderboard
export PYTHONPATH=$PYTHONPATH:${WORK_DIR}/B2DVL_Adapter
export SCENARIO_RUNNER_ROOT=${WORK_DIR}/scenario_runner
export LEADERBOARD_ROOT=${WORK_DIR}/leaderboard
export VQA_GEN=1
export STRICT_MODE=1
Environment Variables
- VQA_GEN: Must set to a value > 0 to tell the framework that we are currently in Bench2Drive-VL environment.
- STRICT_MODE: DriveCommenter drives the ego vehicle after circumventing obstacles back to its original lane and handle more out of distribution situations if
STRICT_MODE > 0
. Must set to true if doing a closed-loop evaluation.
Activate the environment
Make sure you source this script before running:
source ./env.sh