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.
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.
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.
If you want to reproduce results from the paper, the data file slide_example.npz is provided. slide_example2.npz is another nice example.
Three different estimators are found in this directory.
- orbitEKF.py is an EKF estimator
- orbitFG.py is the full factor graph estimator.
- 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.)
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...).
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