diff --git a/CHANGELOG.md b/CHANGELOG.md index c53cd531d..3923acc67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ ## Latest +## Pylot 0.3.2 + * Fixed bug in parsing CARLA version strings. + * Fixed EfficientDet detection operator so that it correctly extracts bounding boxes. + * Added indicator stream to logging operators so that they can be used for synchronizing. + * Added CenterTrack obstacle tracker. + * Fixed LaneNet imports. + * Lock pygame to a working version. + * Added code to handle top watermarks in watermark callbacks. + * Added new tracker evaluation operator, and base eval class. + * Added support for CARLA 0.9.11. + * Added option to enable evaluation operators to the challenge agent. + ## Pylot 0.3.1 * Improved perfect lane detector to collect all lanes. * Added support for latest CARLA lidar type (CARLA >= 0.9.9.4). diff --git a/README.md b/README.md index b36ac030a..59ba89b0e 100644 --- a/README.md +++ b/README.md @@ -77,13 +77,13 @@ pip install -e ./ Next, start the simulator: ```console -export CARLA_HOME=$PYLOT_HOME/dependencies/CARLA_0.9.8/ +export CARLA_HOME=$PYLOT_HOME/dependencies/CARLA_0.9.10.1/ ./scripts/run_simulator.sh ``` In a different terminal, setup the paths: ```console -export CARLA_HOME=$PYLOT_HOME/dependencies/CARLA_0.9.8/ +export CARLA_HOME=$PYLOT_HOME/dependencies/CARLA_0.9.10.1/ cd $PYLOT_HOME/scripts/ source ./set_pythonpath.sh ``` diff --git a/doc/source/manual_installation.rst b/doc/source/manual_installation.rst index 1a62cd7c6..173e7d811 100644 --- a/doc/source/manual_installation.rst +++ b/doc/source/manual_installation.rst @@ -15,14 +15,14 @@ Next, start the simulator: .. code-block:: bash - export CARLA_HOME=$PYLOT_HOME/dependencies/CARLA_0.9.8/ + export CARLA_HOME=$PYLOT_HOME/dependencies/CARLA_0.9.10.1/ ./scripts/run_simulator.sh In a different terminal, setup the paths: .. code-block:: bash - export CARLA_HOME=$PYLOT_HOME/dependencies/CARLA_0.9.8/ + export CARLA_HOME=$PYLOT_HOME/dependencies/CARLA_0.9.10.1/ cd $PYLOT_HOME/scripts/ source ./set_pythonpath.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 866e92bb1..92c768ad0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,7 +33,7 @@ RUN sudo DEBIAN_FRONTEND=noninteractive sudo DEBIAN_FRONTEND=noninteractive apt- RUN sudo apt-get -y update RUN sudo apt-get -y install git curl clang python3 python3-pip RUN python3 -m pip install --upgrade pip -RUN pip3 install setuptools setuptools-rust +RUN python3 -m pip install setuptools setuptools-rust numpy==1.19.5 RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/home/erdos/.cargo/bin:${PATH}" RUN rustup default nightly @@ -41,27 +41,27 @@ RUN mkdir -p /home/erdos/workspace RUN cd /home/erdos/workspace && git clone https://github.com/erdos-project/erdos.git && cd erdos && python3 python/setup.py install --user # Set up Pylot. -RUN sudo apt-get install -y python3-pip libcudnn7 cuda-toolkit-10-0 ssh libqt5core5a libeigen3-dev cmake qtbase5-dev libpng16-16 libtiff5 +RUN sudo apt-get install -y libcudnn7 cuda-toolkit-10-0 ssh libqt5core5a libeigen3-dev cmake qtbase5-dev libpng16-16 libtiff5 python3-tk # Get the Pylot directory. RUN cd /home/erdos/workspace && git clone https://github.com/erdos-project/pylot.git WORKDIR /home/erdos/workspace/pylot/ ENV PYLOT_HOME /home/erdos/workspace/pylot/ # Install all the Python dependencies. -RUN cd /home/erdos/workspace/pylot/ && pip3 install -e ./ +RUN cd /home/erdos/workspace/pylot/ && python3 -m pip install -e ./ # Get the Pylot models and code dependencies. RUN cd /home/erdos/workspace/pylot/ && ./install.sh -ENV CARLA_HOME /home/erdos/workspace/pylot/dependencies/CARLA_0.9.11 +ENV CARLA_HOME /home/erdos/workspace/pylot/dependencies/CARLA_0.9.10.1 # Clone scenario_runner. -RUN cd /home/erdos/workspace && git clone https://github.com/erdos-project/scenario_runner.git +RUN cd /home/erdos/workspace && git clone https://github.com/erdos-project/scenario_runner.git # Install scenario_runner's dependencies. -RUN pip3 install py-trees==0.8.3 networkx==2.2 Shapely==1.6.4 psutil xmlschema==1.0.18 ephem tabulate +RUN python3 -m pip install py-trees==0.8.3 networkx==2.2 Shapely==1.6.4 psutil==5.7.0 xmlschema==1.0.18 ephem==3.7.6.0 tabulate==0.8.7 six==1.14.0 # Clone leaderboard. -RUN git clone https://github.com/erdos-project/leaderboard.git -RUN pip3 install dictor requests +RUN cd /home/erdos/workspace && git clone https://github.com/erdos-project/leaderboard.git +RUN python3 -m pip install dictor requests -RUN echo "export PYTHONPATH=/home/erdos/workspace/pylot/dependencies/:/home/erdos/workspace/pylot/dependencies/CARLA_0.9.11/PythonAPI/carla/dist/carla-0.9.11-py3.7-linux-x86_64.egg:/home/erdos/workspace/pylot/dependencies/CARLA_0.9.11/PythonAPI/carla/:/home/erdos/workspace/pylot/dependencies/CARLA_0.9.11/PythonAPI/carla/agents/:/home/erdos/workspace/pylot/dependencies/CARLA_0.9.11/PythonAPI/:/home/erdos/workspace/scenario_runner" >> ~/.bashrc +RUN echo "export PYTHONPATH=/home/erdos/workspace/pylot/dependencies/:/home/erdos/workspace/pylot/dependencies/CARLA_0.9.10.1/PythonAPI/carla/dist/carla-0.9.10-py3.7-linux-x86_64.egg:/home/erdos/workspace/pylot/dependencies/CARLA_0.9.10.1/PythonAPI/carla/:/home/erdos/workspace/pylot/dependencies/CARLA_0.9.10.1/PythonAPI/carla/agents/:/home/erdos/workspace/pylot/dependencies/CARLA_0.9.10.1/PythonAPI/:/home/erdos/workspace/scenario_runner" >> ~/.bashrc RUN echo "export PYLOT_HOME=/home/erdos/workspace/pylot/" >> ~/.bashrc -RUN echo "export CARLA_HOME=/home/erdos/workspace/pylot/dependencies/CARLA_0.9.11" >> ~/.bashrc +RUN echo "export CARLA_HOME=/home/erdos/workspace/pylot/dependencies/CARLA_0.9.10.1" >> ~/.bashrc RUN echo "if [ -f ~/.bashrc ]; then . ~/.bashrc ; fi" >> ~/.bash_profile # Set up ssh access to the container. diff --git a/install.sh b/install.sh index 25a2a2a3a..2e20369e1 100755 --- a/install.sh +++ b/install.sh @@ -9,10 +9,10 @@ fi sudo apt-get -y update sudo apt-get install -y git wget cmake python3-pip unzip clang libpng-dev libgeos-dev -pip3 install gdown --user # Install opencv separately because pip3 install doesn't install all libraries # opencv requires. sudo apt-get install -y python3-opencv +python3 -m pip install --user gdown ############################################################################### # Get models & code bases we depend on @@ -159,12 +159,12 @@ git clone https://github.com/mileyan/AnyNet.git cd AnyNet/models/spn_t1/ ; python3 setup.py clean ; python3 setup.py build ###### Download the Carla simulator ###### -echo "[x] Downloading the CARLA 0.9.11 simulator..." +echo "[x] Downloading the CARLA 0.9.10.1 simulator..." cd $PYLOT_HOME/dependencies/ -if [ "$1" != 'challenge' ] && [ ! -d "CARLA_0.9.11" ]; then - mkdir CARLA_0.9.11 - cd CARLA_0.9.11 - wget https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/CARLA_0.9.11.tar.gz - tar -xvf CARLA_0.9.11.tar.gz - rm CARLA_0.9.11.tar.gz +if [ "$1" != 'challenge' ] && [ ! -d "CARLA_0.9.10.1" ]; then + mkdir CARLA_0.9.10.1 + cd CARLA_0.9.10.1 + wget https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/CARLA_0.9.10.1.tar.gz + tar -xvf CARLA_0.9.10.1.tar.gz + rm CARLA_0.9.10.1.tar.gz fi diff --git a/pylot/planning/frenet_optimal_trajectory/fot_planner.py b/pylot/planning/frenet_optimal_trajectory/fot_planner.py index 40f15c916..6b03a15bd 100644 --- a/pylot/planning/frenet_optimal_trajectory/fot_planner.py +++ b/pylot/planning/frenet_optimal_trajectory/fot_planner.py @@ -20,6 +20,7 @@ def __init__(self, world, flags, logger): super().__init__(world, flags, logger) self.s0 = 0.0 self._hyperparameters = { + "num_threads": 1, "max_speed": flags.max_speed, "max_accel": flags.max_accel, "max_curvature": flags.max_curvature, diff --git a/pylot/simulation/carla_operator.py b/pylot/simulation/carla_operator.py index 094ae8d85..0bc4bf31e 100644 --- a/pylot/simulation/carla_operator.py +++ b/pylot/simulation/carla_operator.py @@ -302,17 +302,11 @@ def run(self): # they register a listener. Thus, we sleep here a bit to # give them sufficient time to register a callback. time.sleep(4) - registered_callback = False - if pylot.simulation.utils.check_simulator_version( - self._simulator_version, required_minor=9, required_patch=11): - self._world.on_tick(self.send_actor_data) - registered_callback = True self._tick_simulator() time.sleep(4) - if not registered_callback: - # The older CARLA versions require an additional tick to sync - # sensors. - self._world.on_tick(self.send_actor_data) + # The older CARLA versions require an additional tick to sync + # sensors. + self._world.on_tick(self.send_actor_data) self._tick_simulator() def _initialize_world(self): diff --git a/pylot/simulation/challenge/ERDOSAgent.py b/pylot/simulation/challenge/ERDOSAgent.py index c8c31d16f..3ef44ae2a 100644 --- a/pylot/simulation/challenge/ERDOSAgent.py +++ b/pylot/simulation/challenge/ERDOSAgent.py @@ -167,8 +167,13 @@ def run_step(self, input_data, timestamp): e2e_runtime = (time.time() - start_time) * 1000 self.csv_logger.info('{},{},e2e_runtime,{:.4f}'.format( pylot.utils.time_epoch_ms(), game_time, e2e_runtime)) - # return command, int(e2e_runtime) - return command + if FLAGS.simulator_mode == 'synchronous': + return command + elif FLAGS.simulator_mode == 'pseudo-asynchronous': + return command, int(e2e_runtime) + else: + raise ValueError('Unexpected simulator_mode {}'.format( + FLAGS.simulator_mode)) def send_localization(self, timestamp, imu_data, gnss_data, speed_data): if FLAGS.localization: diff --git a/pylot/simulation/utils.py b/pylot/simulation/utils.py index 078fd9db4..840559866 100644 --- a/pylot/simulation/utils.py +++ b/pylot/simulation/utils.py @@ -19,8 +19,9 @@ def check_simulator_version(simulator_version: str, """Checks if the simulator meets the minimum version requirements.""" ver_strs = simulator_version.split('.') if len(ver_strs) < 2 or len(ver_strs) > 3: - raise ValueError( - 'CARLA version {} is not supported'.format(simulator_version)) + print('ERROR: CARLA version {} is not supported; assuming this is ' + 'version 0.9.10'.format(simulator_version)) + ver_strs = '0.9.10'.split('.') major = int(ver_strs[0]) minor = int(ver_strs[1]) if major != required_major: diff --git a/requirements.txt b/requirements.txt index 1bd685f3d..6b3d1776d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,9 @@ absl-py cvxpy erdos>=0.3.1 -gdown lapsolver motmetrics -numpy<1.17 +numpy<1.20 open3d-python==0.5.0.0 opencv-python>=4.1.0.25 opencv-contrib-python>=4.1.0.25 diff --git a/setup.py b/setup.py index 889fa9942..a158dbf0a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="erdos-pylot", - version="0.3.1", + version="0.3.2", author="Pylot Team", description=("A platform for developing autonomous vehicles."), long_description=open("README.md").read(), @@ -14,10 +14,9 @@ "absl-py", "cvxpy", "erdos>=0.3.1", - "gdown", "lapsolver", "motmetrics", - "numpy<1.17", # Update to newer numpy version once we switch to tf2 + "numpy<1.20", # Update to newer numpy version once we switch to tf2 "open3d-python==0.5.0.0", "opencv-python>=4.1.0.25", "opencv-contrib-python>=4.1.0.25", @@ -37,7 +36,7 @@ "imgaug==0.2.8", "matplotlib==2.2.4", "nonechucks==0.3.1", - "nuscenes-devkit" + "nuscenes-devkit", "progress", "pyquaternion", "scikit-learn==0.22.2",