/Autonomous-Truck-Sim

Simulation Environment with an implementation of an autonomous truck in a multi-lane highway scenario.

Primary LanguagePython

Autonomous Truck Simulator

Author: Erik Börve, borerik@chalmers.se

Purpose

This project provides an implementation of an autonomous truck in a multi-lane highway scenario. The controller utilizes non linear optimal control to compute multiple trajectories, of which the most cost-efficent is choosen.

Getting Started

Prerequisites

Clone the project in your local machine:

git clone <repository cloning url>

The environment is created for python 3.9.10. Using conda this can be set as:

conda create --name Autonomous-Truck-Sim python=3.9.10 -y
source activate Autonomous-Truck-Sim

Finally, install dependencies:

pip install -r requirements.txt

Usage

Simulations are run via the "main" file. This is also where simulations are configured, including e.g., designing traffic scenarios and setting up the optimal controllers.

Project Structure

The projects contains the following files.

.
├── controllers.py
├── Data_example
    └── ex1.csv
    └── metaData_ex1.txt
├── gitignore
├── helpers.py
├── main.py
├── README.md
├── requirements.txt
├── scenarios.py
├── simRes.gif
├── templateRLagent.py
├── traffic.py
└── vehicleModelGarage.py

controllers.py

makeController: Generates optimal controller based on specified scenario.

decisionMaster: Optimizes the trajectory choice, returns optimal policy.

helpers.py

Contains assisting functions, e.g., for data extraction and plotting.

main.py

Running and setting up simulations.

scenarios.py

Formulates constraints for the different scenarios considered in the optimal controllers.

templateRLagent.py

Template class for communicating with the lower level controllers.

traffic.py

Combined traffic: Used to communicate with all vehicles in traffic scenario.

vehicleSUMO: Creates a vehicle with specified starting position, velocity and class.

vehicleModelGarage.py

Contains truck models that can be utilized in the simulation.