A python package that computes an optimal motion plan for approaching a red light

Overview

Code style: black License: AGPL v3

redlight_approach

redlight_approach is a Python package that computes an optimal motion plan during traffic light approach.

RLA_demo.mov

Given the parameters of the road and vehicle, and a probability distribution describing when the traffic light will turn green, redlight_approach finds the optimal motion plan to minimize the expected amount of time spent traversing the intersection. It enacts the motion plan in a SUMO simulation, and a standard human driver is simulated for comparison. It reports the difference in time between the vehicles. The simulation above is cherry-picked, but typical use involves running many simulations with the red light duration sampled from the probability distribution. Preliminary findings show that this traffic light approach planner will save vehicles time in realistic scenarios.

Next Steps: Baysian Updating from World State

Currently, redlight_approach uses a fixed green light event probability distribution throughout a single approach. It's clear this is naive, as there is information about the traffic light cycle available through observation of the world state. For instance, seeing a vehicle slow down that is approaching the intersection perpendicular to your approach, indicates that their traffic light is no longer green. This suggests that your light may turn green soon, depending on the traffic light cycle. There are other possible information sources, like direct observation of the light from another vehicle of a connected fleet. Updating the distribution from an observation of the world during approach would increase the performance of the system.

Formally, the goal of this part of the project is to map world state to a Baysian update of the probability distribution. Specifically, this will involve using a neural net to map an aspect of world state, like the position of other vehicles, to a likelyhood function defined over the support of the green light event. This requires a dataset which will be generated by running many simulations. This effort is currently underway in the baysian_update branch.

Requirements

  1. Linux or macOS

  2. Miniconda or Anaconda
    To install, visit Conda Installation

  3. SUMO: Installation instructions for Linux (Ubuntu) and macOS

Install SUMO (Ubuntu)

  1. Build SUMO from source (see SUMO Linux Build for more details)
sudo apt-get install git cmake python3 g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev
git clone --recursive https://github.com/eclipse/sumo
export SUMO_HOME="$PWD/sumo"
mkdir sumo/build/cmake-build && cd sumo/build/cmake-build
cmake ../..
make -j$(nproc)
sudo make install

Install SUMO (macOS)

  1. Install Homebrew if you don't have it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install XQuartz with Homebrew:
brew install --cask xquartz
  1. Install SUMO with Homebrew:
brew tap dlr-ts/sumo
brew install sumo

Installation of redlight_approach

  1. Edit .bashrc or .zshrc:
  • Add these lines to your shell's config file:

    # Your .bashrc or .zshrc file
    
    export SUMO_HOME="/path/to/sumo"
    export PYTHONPATH="$PYTHONPATH:/path/to/parent/"
    
  • Replace /path/to/sumo above with your sumo location, which you can find with which sumo.

  • Replace /path/to/parent above with the directory into which you clone this repo, which you can find with pwd.

  • Load these environment variables with

    source ~/.bashrc
    # or 
    source ~/.zshrc
    
  1. Clone this repository:
git clone https://github.com/basilforlife/redlight_approach.git
  1. Change directories to the root of redlight_approach:
cd redlight_approach
  1. Create and activate conda env:
conda env create -f environment.yml
conda activate rla
  1. If you're going to contribute, add pre-commit hooks:
pre-commit install

Usage

Confirm installation was successful with the test suite:

pytest

Typical Use

Run the default scenario with the -g (graphical) option:
Note: on macOS, XQuartz must be running in order to use the graphical option. Start XQuartz from the application folder.

python simple_comparison.py -c parameter_files/original.json -g

To speed up future runs use the the -p option:

python simple_comparison.py -c parameter_files/original.json -p original.pickle

On subsequent runs, use -u to load the same configuration as before:

python simple_comparison.py -u original.pickle

To plot the result of N runs, use the -N option:

python simple_comparison.py -u original.pickle -N 100

For a complete list of options, use the -h option:

python simple_comparison.py -h

License

This work is licensed under the GNU Affero General Public License v3.0. Feel free to contact me if you have any questions about the project.

Owner
Jonathan Roy
Jonathan Roy
Enhanced version of blender's bvh add-on with more settings supported. The bvh's rest pose should have the same handedness as the armature while could use a different up/forward definiton.

Enhanced bvh add-on (importer/exporter) for blender Enhanced bvh add-on (importer/exporter) for blender Enhanced bvh importer Enhanced bvh exporter Ho

James Zhao 16 Dec 20, 2022
An open source server for Super Mario Bros. 35

SMB35 A custom server for Super Mario Bros. 35 This server is highly experimental. Do not expect it to work without flaws.

Yannik Marchand 162 Dec 07, 2022
With Christmas and New Year ahead, it is time for some festive coding. Here is a Christmas Card for you all!

Christmas Card With Christmas and New Year ahead, it is time for some festive coding! Here is a Christmas Card for you all! NOTE: I have not made this

CodeMaster7000 1 Dec 25, 2021
Speed up your typing by some exercises in the multi-platform(Windows/Ubuntu).

Introduction This project purpose is speed up your typing by some exercises in the multi-platform(Windows/Ubuntu). Build Environment Software Environm

lyfer233 1 Mar 24, 2022
Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls

guess-the-numbers Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls Number guessing game

Amir Hussein Sharifnezhad 5 Oct 09, 2021
JARVIS PC Assistant is an assisting program to make your computer easier to use

JARVIS-PC-Assistant JARVIS PC Assistant is an assisting program to make your computer easier to use Welcome to the J.A.R.V.I.S. PC Assistant help file

Dasun Nethsara 2 Dec 02, 2022
Odoo. Open Source Apps To Grow Your Business.

Odoo Odoo is a suite of web based open source business apps. The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Mana

Odoo 27.6k Jan 09, 2023
A data engineering project with Kafka, Spark Streaming, dbt, Docker, Airflow, Terraform, GCP and much more!

Streamify A data pipeline with Kafka, Spark Streaming, dbt, Docker, Airflow, Terraform, GCP and much more! Description Objective The project will stre

Ankur Chavda 206 Dec 30, 2022
A Sophisticated And Beautiful Doxing Tool

Garuda V1.1 A Sophisticated And Beautiful Doxing Tool Works on Android[Termux] | Linux | Windows Don't Forget to give it a star ❗ How to use ❓ First o

The Cryptonian 67 Jan 10, 2022
Aerial Ace is a helper bot for poketwo which provide various functionalities on top of being a pokedex.

Aerial Ace is a helper bot for poketwo which provide various functionalities on top of being a pokedex.

Devanshu Mishra 1 Dec 01, 2021
Up to date simple useragent faker with real world database

fake-useragent info: Up to date simple useragent faker with real world database Features grabs up to date useragent from useragentstring.com randomize

Victor K. 2.9k Jan 04, 2023
Push a record and you will receive a email when that date

Push a record and you will receive a email when that date

5 Nov 28, 2022
Pymon is like nodemon but it is for python,

Pymon is like nodemon but it is for python,

Swaraj Puppalwar 2 Jun 11, 2022
A comprensive software collection for nmea manipulation

nmeatoolkit A comprensive software collection for nmea manipulation; it includes a library and a collections of command line tools. Library pipes: con

Davide Gessa 1 Sep 14, 2022
TurtleBot Control App - TurtleBot Control App With Python

TURTLEBOT CONTROL APP INDEX: 1. Introduction 2. Environments 2.1. Simulated Envi

Rafanton 4 Aug 03, 2022
Morth - Stack Based Programming Language

Morth WARNING! THIS LANGUAGE IS A WORKING PROGRESS. THIS IS JUST A HOBBY PROJECT

Dominik Danner 2 Mar 05, 2022
samples of neat code

NEAT-samples Some samples of code and config files for use with the NEAT-Python package These samples are largely copy and pasted, so if you

Harrison 50 Sep 28, 2022
Скрипт позволяет выгрузить участников чатов/каналов(по чату для комментариев) и сообщения в различные форматы файлов.

TG-Parser Парсер участников и сообщений из ТГ-Чатов и чатов для комментариев в ТГ-Каналах Возможности Выгрузка участников групп/каналов(по чату для ко

50 Jan 06, 2023
Module for working with the site dnevnik.ru with python

dnevnikru Module for working with the site dnevnik.ru with python Dnevnik object accepts login and password from the dnevnik.ru account Methods: homew

Aleksandr 21 Nov 21, 2022
Python package for reference counting native pointers

refcount master: testing: This package is primarily for managing resources in native libraries, written for instance in C++, from Python. While it boi

CSIRO Hydroinformatics 2 Nov 03, 2022