-
Clone this repository.
$ git clone https://github.com/Tinker-Twins/AutoDRIVE-AVLDC.git
-
Give executable permissions to all the Python scripts.
$ cd <path/to/cloned/repo> $ sudo chmod +x *.py
-
Install the necessary dependencies as mentioned below. AutoDRIVE Devkit's Python API has the following dependencies (tested with Python 3.8, 3.9 and 3.10):
-
Websocket-related dependencies for communication bridge between AutoDRIVE Simulator and AutoDRIVE Devkit (version sensitive):
Package Python 3.8 Python 3.9 Python 3.10 eventlet 0.33.3 0.33.3 0.33.3 Flask 1.1.1 1.1.1 1.1.1 Flask-SocketIO 4.1.0 4.1.0 4.1.0 python-socketio 4.2.0 4.2.0 4.2.0 python-engineio 3.13.0 3.13.0 3.13.0 greenlet 1.0.0 1.0.0 1.1.0 gevent 21.1.2 21.1.2 21.12.0 gevent-websocket 0.10.1 0.10.1 0.10.1 Jinja2 3.0.3 3.0.3 3.0.3 itsdangerous 2.0.1 2.0.1 2.0.1 werkzeug 2.0.3 2.0.3 2.0.3 -
Generic dependencies for data processing and visualization (usually any version will do the job):
Package Tested Version numpy 1.13.3 pillow 5.1.0 opencv-contrib-python 4.5.1.48 -
Install dependencies using
requirements.txt
file (use the file specific to your Python version → check usingpython3 --version
):$ pip3 install -r requirements_python_3.8.txt # Python 3.8 $ pip3 install -r requirements_python_3.9.txt # Python 3.9 $ pip3 install -r requirements_python_3.10.txt # Python 3.10
-
-
Download, unzip and launch the AutoDRIVE Simulator by referring to the detailed instructions given here:
-
Launch AutoDRIVE Devkit to create a shared memory for the AVL Model.CONNECT project. Execute the
opencav
Python3 script for teleoperating the OpenCAV, employing the AutoDRIVE Python API.$ cd <path/to/opencav.py> $ python3 opencav.py
-
Launch and run the AVL Model.CONNECT project, which connects to the shared memory created by the AutoDRIVE Devkit using AVL Python API.
Notes:
- Launching AutoDRIVE Devkit alone will print the default value for all the bytes that haven't yet been written to (since they are written by the AVL Model.CONNECT project). The bytes written by the AutoDRIVE Devkit itself will be updated and printed accordingly.
- Launching the AVL Model.CONNECT project before the AutoDRIVE Devkit will throw an error since the shared memory has not yet been created.
OpenCAV Teleoperation Demo Result | ||
---|---|---|
AutoDRIVE Simulator | AutoDRIVE Devkit | AVL Model.CONNECT |
-
Download, unzip and launch the AutoDRIVE Simulator by referring to the detailed instructions given here:
-
Launch AutoDRIVE Devkit to execute AEB script (a) or (b), which also creates a shared memory for the AVL Model.CONNECT project.
(a) Execute the
aeb_emulation
Python3 script for demonstrating the "emulated" autonomous emergency braking (AEB) function with OpenCAV, employing the AutoDRIVE Python API. This algorithm uses ground truth distance to collision (DTC) metric to trigger AEB.$ cd <path/to/aeb_emulation.py> $ python3 aeb_emulation.py
(b) Execute the
aeb_stimulation
Python3 script for demonstrating the "stimulated" autonomous emergency braking (AEB) function with OpenCAV, employing the AutoDRIVE Python API. This algorithm uses camera-based perception for object detection and classification, and triggers the AEB based on the class, size and confidence of the detection.$ cd <path/to/aeb_stimulation.py> $ python3 aeb_stimulation.py
-
Launch and run the AVL Model.CONNECT project, which connects to the shared memory created by the AutoDRIVE Devkit using AVL Python API.
Notes:
- Launching AutoDRIVE Devkit alone will print the default value for all the bytes that haven't yet been written to (since they are written by the AVL Model.CONNECT project). The bytes written by the AutoDRIVE Devkit itself will be updated and printed accordingly.
- Launching the AVL Model.CONNECT project before the AutoDRIVE Devkit will throw an error since the shared memory has not yet been created.
OpenCAV AEB Demo Result: Emulation Mode | ||
---|---|---|
AutoDRIVE Simulator | AutoDRIVE Devkit | AVL Model.CONNECT |
OpenCAV AEB Demo Result: Stimulation Mode | ||
---|---|---|
AutoDRIVE Simulator | AutoDRIVE Devkit | AVL Model.CONNECT |