Giter Site home page Giter Site logo

mldeadreckoning's Introduction

ML Dead Reckoning Project

You can read our final report HERE!

Background

GPS has many crucial applications, like vehicle navigation. However, in urban environments where tall obstructions (like buildings) can block GPS, the vehicle needs more information about its surroundings, which sensors like IMUs can provide. However, IMUs tend to drift over time and this offset can be different across different IMU calibrations. To resolve this, vehicles rely on a fusion of sensor data, but this can add significantly to system cost and complexity. Therefore, this project aims to use machine learning to estimate vehicle position in GPS-poor environments.

Methodology

Data Collection

In order to design, train, and validate our models, we need IMU data from a moving vehicle, as well as a source of ground truth position information. We used an ICM-20948 as the primary IMU, with an XA1110 GPS module to provide concrete position information to validate against. Both were connected to a Raspberry Pi which logged the data at 200Hz for the IMU, and 1Hz for the GPS. With this setup, we were able to collect approximately 16 hours of driving data ourselves.

Data Processing

  • split the data into smaller segments when the vehicle is stationary: This allows us to isolate specific maneuvers (i.e. turns, straights, etc), and also zero out IMU drift based on the stationary periods.

  • Interpolate samples: Required because the GPS is sampled at a lower rate (1 Hz) than the IMU (200 Hz).

  • Align GPS and IMU position curves using RANSAC: Since the IMU does not have a reference for absolute heading, and our self-collected dataset was not large, we used the RANSAC algorithm to register the GPS and IMU position curves together as closely as possible before handing off the data to the neural net architecture.

  • Train NN to output predicted vehicle position using DAgger method with Seq2Seq model and encoder/decoder architecture: We pass in the pre-processed IMU and GPS positions as input to our NN so that it can learn to predict vehicle position with limited access to GPS data at test time.

Results

Through our methods, we were able to recover a vehicle position curve (green + red) from imu data (blue) that was far closer to the ground truth (black) than the imu data. The red segments on the predicted position line indicate segments of GPS outage, where our trained model is able to predict the vehicle's true position without any GPS data. As a note, the gif is running at 10x speed, and this trajectory represents a path we collected in a personal vehicle.

Conclusion

Overall, our approach is able to recover true position in GPS-poor environments with good performance over long distances travelled by the vehicle, generalizable and robust to non-uniform sensor offset and drift, and can be replicated in real driving environments with relatively low cost.

In the future, we want to work towards true dead-reckoning, where we only use the IMU data as an input. To do this, we would first need to solve the inconsistency in gyro offset between different runs. If we resolved this issue, we can consider two approaches to achieve true dead-reckoning with only IMU data:

  1. (Existing Approach) Adapt our solution in this project for 100% GPS dropout
  2. (New Approach) Develop an ML model to update the covariance matrices (or uncertainty) of a Kalman Filter, which is commonly used to predict state estimates of a vehicle

Getting Started

Ensure you have the following data file structure before running any code:

  • csv/
    • 200hz/
    • 50hz/
  • gps_vs/
  • gpx/
  • imu_vs/
  • split_csv/
    • 200hz/
    • 50hz/

To generate the necessary files:

  1. download all the gps files from here and place into the csv/200hz directory.

  2. Run the following from the Scripts/ directory to generate the proper files (this will take a while, like 15-30 minutes):

     python split_csv.py && python process_data.py && python gps_to_vel.py && python sync_curves.py --save_pos 
    
  3. To evaluate the model trained with , run:

    python seq2seq.py --dataset_csv "full_dataset.csv" --test_files "full_dataset_test_list.txt" --eval_model seq2seqmodel_1.0beta_noannealing --gps_dropout 0.3
     

    To evaluate the model trained with , run:

    
     python seq2seq.py --dataset_csv "full_dataset.csv" --test_files "full_dataset_test_list.txt" --eval_model seq2seqmodel_0.75beta_noannealing --gps_dropout 0.3
     
  4. (Optional) To generate the gpx files, run python log_to_gpx.py from the Scripts/ directory. You can view them in a gpx visualizer like gpsvisualizer.com.

mldeadreckoning's People

Contributors

abhaagrawal avatar cindydeng1998 avatar mbankole avatar tyu91 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.