Skip to content
Python package to process NGSIM data and traffic sensing with autonomous vehicles
Jupyter Notebook Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

High-resolution Traffic Sensing with Autonomous Vehicles

Implemented by Wei Ma, advised by Sean Qian, Civil and environmental engineering, Carnegie Mellon University.


  • Python 3.6.8
  • Numpy 1.15.2
  • Scipy 0.19.1
  • pickle
  • pandas 0.20.2
  • pytz
  • shapely 1.6.4.post2


The repo contains two major components: NGSIM reader and traffic sensing.

NGSIM Reader

NGSIM reader is implemented in class ngsim_data. Simply initialize a ngsim_data object and then call read_from_csv(filename) to read the NGSIM data. The NGSIM data can be downloaded from NGSIM dataset website.

It takes a long time to run once, but once read_from_csv function is done, you can dump the object using dump function. The next time you want to use the ngsim_data object, you only need to use load function instead of read_from_csv.

The NGSIM data is stored in two different forms at the same time: vehicle trajectory and snapshot at each timestamp. For implementation details, please check the codes.

Traffic sensing

Traffic sensing contains many components including lidar, data center, space-time mesh, etc. We suggest starting from reading the file. This file contains only one function that runs our proposed sensing algorithms with various parameters as input.

You can also reproduce our experiments by first cloning the whole repo, then run running_scripts.ipynb using jupyter notebook. Finally all plots in the paper can be generated by generate_plot.ipynb.

File specifications

  • Data_Generation.ipynb: give you an example of how to use ngsim_data class to generate various experiment settings (not actually used in our experiments.)
  • analyze_coef.ipynb: analyze the regression coefficients in linear regression for estimating speed. See the paper for details.
  • generate_plot.ipynb: the script that generates all figures in the paper.
  • estimation accuracy measurement functions.
  • all classes related to NGSIM data.
  • parameter settings.
  • running_scripts.ipynb: the script that prepares all the data for enerate_plot.ipynb.
  • algorithms that estimtates speed and density
  • integrate the functionalities in and It is used for the experiments of our paper.
  • Built on top of to run experiments on three different roads.


High-Resolution Traffic Sensing with Autonomous Vehicles


NGSIM dataset


For any question, please contact

You can’t perform that action at this time.