Skip to content

This repository contains the necessary code to rectify the predicted vehicular locations based on a modified Kalman filter. The rectification process is made road aware by the use of a lane-shape, which improves the accuracy of predicted geo-coordinate. The geo-coordinates, i.e., long. and lat., were used instead of x and y coordinates. Several …

Notifications You must be signed in to change notification settings

asifgit/rectification-of-location-prediction-vehicles

Repository files navigation

Overview (Rectification of Kalman filter based location predictions)

This repository contains the necessary code to rectify the predicted vehicular locations based on a modified Kalman filter. The rectification process is made road aware by the use of a lane-shape, which improves the accuracy of predicted geo-coordinate. The geo-coordinates, i.e., long. and lat., were used instead of x and y coordinates. Several mathematical concepts were embedded into the Kalman filter and the Rectification process.

Note: All of the code is open source and free to use. If anyone of you is interested, please drop a question or email me at malikasifmahmoodawan@gmail.com.

Rectification

Below figure depicts the mechanism of rectification. Rectification mechanism

vTracheaStore

The figure below shows the entity relationship diagram of the roads, lanes, their shapes, junctions, and edges. vTracheaStore Entity Relationship Diagram

Software/Prerequisites (required)

  • Software to be downloaded and installed:
    • PostgreSQL (version: 14.5) - link
    • Anaconda (version: 3) - link
  • If you're unable to find the files on GitHub, download the files / fodlers from here:
    • Database (vTracheaStore) - link
    • Conda environment (virtual environment) - link
    • Jupyter notebooks (rectification code) - link

Importing the vTracheaStore database

Run following cmd / terminal commands to import the database in PostgreSQL. We used postgres as the value of username_of_database:

psql -U username_of_database

In the psql shell, create an empty database named as vTracheaStore as follows

CREATE DATABASE vTracheaStore;

The above command will take you to the PostgreSQL shell. Run the following command to import the downloaded vTracheaStore as follows. We used E:\Akraino-ETSI-MEC-Hackathon\vTracheaStore\vTracheaStore.pgsql as the value of file_path_of_the_downloaded_pgsql_script.pgsql:

\i file_path_of_the_downloaded_pgsql_script.pgsql

or try the below command with a path enclosed in single quots. Please be advised to try the file path both with forward/back-slashes

\i 'file_path_of_the_downloaded_pgsql_script.pgsql'

Hurray, you have successfully imported the vTracheaStore database.

Create a virtual environment

Now that the database is ready, we require you to setup the virtual environment in anaconda for running the jupyter notebooks. In order to do so, run the following commands in cmd / terminal. We used E:\Akraino-ETSI-MEC-Hackathon\Environments\rectificationEnvironment.yml as the value of file_path_of_the_downloaded_yml.yml:

conda env create -f file_path_of_the_downloaded_yml.yml

Once the conda environment is setup, run the following commands to enter into that virtual environment that we just created, and then launch the jupyter notebook:

conda activate etsimeclfedgehackathon2022

Once you entered into the environment, you are ready to launch the jupyter notebook. Just be sure to run the next command in the correct directory where the jupyter notebook exists. Otherwise, you won't be able to see the jupter notebook on your browser at localhost:8888. The command is:

jupyter notebook

Update the PostgreSQL connection defined Jupyter notebook

In the jupyter notebook, you need to change:

  • vtracheastore as database name.
  • password as you initialized.
  • server as localhost or postgreSQL server's IP.

Run the Jupyter notebook for running the tests

Now, we are ready to run the modified kalman filter functions which enable the prediction of vehicle trajectories. These trajectories are loaded from the vTracheaStore database, which are then processed by the rectification-assisted modified kalman filter. These predicted and rectified vehicle coordinates longitude, latitude are then stored back in the vTracheaStore. Based on the tests, we then evaluate the predicted and rectified numerically as well as visually.

Conclusion:

The rectification-assisted location prediction significantly enhances the performance of kalman filter location prediction. This solution uses the road/lane coordinates to rectify the predicted location, which we stored in the vTracheaStore.

Summarized model

Below is the summarized and self explantory model of modified Kalman filter which shows the rectification integrated into the Kalman filter. Modified Kalman Filter - Model

About

This repository contains the necessary code to rectify the predicted vehicular locations based on a modified Kalman filter. The rectification process is made road aware by the use of a lane-shape, which improves the accuracy of predicted geo-coordinate. The geo-coordinates, i.e., long. and lat., were used instead of x and y coordinates. Several …

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published