This repository is the implementation of the open-sourced package, the GraphGNSSLib, which makes use of the factor graph optimization (FGO) to perform the GNSS positioning and real-time kinematic (RTK) positioning. In this package, measurements from the historical and current epochs are structured into a factor graph which is then solved by non-linear optimization. The package is based on C++ which is compatible with the robot operation system (ROS) platform. Meanwhile, this package combines the RTKLIB (version: 2.4.3 b33) to read/decode the GNSS RINEX files. Users from Robotics field can easily have access to GNSS raw data for further study.
Important Notes:
- Be noted that the GNSS Positioning mentioned throughout the package means estimating the positioing of the GNSS receiver based on the combination of pseudorange and Doppler measurements uisng FGO.
- Be noted that the GNSS-RTK Positioning mentioned throughout the package means estimating the positioing (float solution) of the GNSS receiver based on the combination of double-differenced pseudorange, carrier-phase and the Doppler measurements using FGO. Finally, the ambiguity is resolved using LAMBDA algorithm.
Authors: Weisong Wen, Li-ta Hsu from the Intelligent Positioning and Navigation Laboratory, The Hong Kong Polytechnic University.
Related Papers: (paper is not exactly same with code)
- Wen, W., & Hsu, L. T. (2021, May). Towards robust GNSS positioning and Real-time kinematic using factor graph optimization. In 2021 IEEE International Conference on Robotics and Automation (ICRA) (pp. 5884-5890). IEEE.
- Wen, W., Zhang, G., & Hsu, L. T. (2021). GNSS outlier mitigation via graduated non-convexity factor graph optimization. IEEE Transactions on Vehicular Technology, 71(1), 297-310.
- Zhong, Y., Wen, W., Ng, H. F., Bai, X., & Hsu, L. T. (2022, September). Real-time Factor Graph Optimization Aided by Graduated Non-convexity Based Outlier Mitigation for Smartphone Decimeter Challenge. In Proceedings of the 35th International Technical Meeting of the Satellite Division of The Institute of Navigation (ION GNSS+ 2022) (pp. 2339-2348).
if you use GraphGNSSLib for your academic research, please cite our related papers
Software flowchart of GraphGNSSLib, more information please refer to mannual and paper.If you are not familiar with ROS, we highly recommend using our docker container to enjoy GraphGNSSLib. For the details, please go to the branch test_docker step 5.
Ubuntu 64-bit 16.04, ROS Kinetic. ROS Installation. We only test it on Ubuntu 16.04 with ROS Kinetic.
Follow the following instructions to install Ceres-solver instead of using the latest version of Ceres-solver.
Step 1: Download the Ceres-solver which is compatible with GraphGNSSLib.
Step 2: make and install
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev
# BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# make Ceres-solver
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver
sudo make -j4
sudo make test
sudo make install
sudo apt-get install ros-kinetic-novatel-msgs
Clone the repository and catkin_make:
mkdir GraphGNSSLib/src
cd ~/GraphGNSSLib/src
mkdir result
git clone https://github.com/weisongwen/GraphGNSSLib.git
cd ../
# if you fail in the last catkin_make, please source and catkin_make again
catkin_make
source ~/GraphGNSSLib/devel/setup.bash
catkin_make
(if you fail in this step, try to find another computer with clean system or reinstall Ubuntu and ROS)
3. Run GNSS positioning via FGO using dataset UrbanNav
The GNSS positioning via FGO is validated using static dataset collected near TST of Hong Kong. Several parameters are as follows:
- GPS second span: 46701 to 47185
- satellite system: GPS/BeiDou
- Window Size: Batch
- measurements considered: double-differenced pseudorange and carrier-phase measurements, Doppler measurements
- result is saved by default
~/GraphGNSSLib/trajectory_psr_dop_fusion.csv
please enable the following in rtklib.h
#define RTK_FGO 0
- Solution 1 to run the GNSS positioning Demo
source ~/GraphGNSSLib/devel/setup.bash # read GNSS raw data and publish as ROS topic # we provide several datasets, enjoy it! roslaunch global_fusion dataublox_TST20190428.launch # run pseudorange and doppler fusion roslaunch global_fusion psr_doppler_fusion.launch
The GNSS RTK-FGO is validated using static dataset collected near TST of Hong Kong. Several parameters are as follows:
- GPS second span: 270149 to 270306
- satellite system: GPS/BeiDou
- Window Size: Batch
- measurements considered: double-differenced pseudorange and carrier-phase measurements, Doppler measurements
- result is saved by default
~/GraphGNSSLib/FGO_trajectoryllh_pdrtk.csv
please enable the following in rtklib.h
#define RTK_FGO 1
- Solution 1 to run the RTK-FGO Demo
source ~/GraphGNSSLib/devel/setup.bash # read GNSS raw data and publish as ROS topic roslaunch global_fusion dataublox_TST20200603.launch # run GNSS RTK roslaunch global_fusion psr_doppler_car_rtk.launch
To run GraphGNSSLib with docker, first make sure docker are installed on your machine. If you want to use the docker to run the global_fusion:
cd ~/catkin_ws/src/GraphGNSSLib/docker
make build
sudo -E ./start.bash #Do not delete " -E "
source devel/setup.bash
# run pseudorange and doppler fusion
roslaunch global_fusion psr_doppler_fusion.launch
# you should open another ternimal to enter the docker.
# read GNSS raw data and publish as ROS topic
roslaunch global_fusion dataublox_TST20190428.launch
Also, there is a video showing the demo after you have built the docker_file in the directory GraphGNSSLib/docker
If you want to restart the container, please stop it first:
sudo ./stop.bash
#then restart it
sudo -E ./start.bash
The directory ~/shared_dir is created to connect the container and the host . In the container, it is located at ~/graph1/shared_dir, you can also download the code to shared_dir and compile the program in the container (Recommended for those who are interested in making changes to the source code)
We use Ceres-solver for non-linear optimization and RTKLIB for GNSS data decoding, etc. Some functions are originated from VINS-mono. The rviz_satellite is used for visualization. If there is any thing inappropriate, please contact me through [email protected] (Weisong WEN). Thank you very much for the maintainance by Mr. Zhong Yihan.
The source code is released under GPLv3 license. We are still working on improving the code reliability. For any technical issues, please contact Weisong Wen [email protected]. For commercial inquiries, please contact Li-ta Hsu [email protected].