Skip to content

An example comparing EKF, factor graphs, and sliding window factors. Used for a paper in the Navigation journal.

Notifications You must be signed in to change notification settings

XinyeMa699/factorGraph2DsatelliteExample

 
 

Repository files navigation

Purpose

The purpose of this repository is to complement the paper "Factor Graphs for Navigation Applications: A Tutorial" by Clark Taylor and Jason Gross in the Navigation journal.

Important files

System Description

In Description.pdf, we describe a system that is supposed to be representative of a satellite observation system. The LaTeX source code is in Description.tex.

Simulation Code

The code is designed such that you run a simultion and it outputs a npz file. This simulation is in OrbitSim.py. Each data file output has the following fields in them.

  • R
  • Q
  • dt
  • meas
  • truth These fields should provide all the data needed to run any of the estimatiors desired. If you want to run lots of different simulations, the file runSims.py can be used.

Data file for paper results

If you want to reproduce results from the paper, the data file slide_example.npz is provided. slide_example2.npz is another nice example.

Estimators

Three different estimators are found in this directory.

  1. orbitEKF.py is an EKF estimator
  2. orbitFG.py is the full factor graph estimator.
  3. orbitSW.py is a sliding window estimator based on the factor graph. Different from the other estimators, this estimator also outputs a timing data file that can be used to evaluate the timing performance of the factor graph for different sliding window sizes.

Each of these estimators, when run, will output a data file (also a numpy data file -- .npz) that contains the result of that estimator. In addition, there are many plots that are generated by each estimator when they run. Some example results files are given in ekf_slide_example_res.npz and fg_slide_example_res.npz. (These files were used to create figures in the paper.)

Plotting files

Using the estimator outputs, gen_accuracy_figs.py can be used to generate plots of a higher quality (print quality) than given when just running the estimator. Similarly, gen_timing_figs.py can be used to generate plots that show the timing performance. The file timing_res_1801_3.npz contains the data used to generate the timing plot in the paper (I believe...).

Environment setup

Finally, if you want to setup your Python environment easily so everything "just runs", you can use the requirements.yml file. I use conda, so I would use

conda env create -f requirements.yml
conda activate factorGraphExample

About

An example comparing EKF, factor graphs, and sliding window factors. Used for a paper in the Navigation journal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.8%
  • TeX 9.2%