gtsam/README.md

134 lines
6.6 KiB
Markdown
Raw Permalink Normal View History

2025-02-11 08:57:18 +08:00
# GTSAM: Georgia Tech Smoothing and Mapping Library
2016-06-06 02:02:54 +08:00
**Important Note**
2023-01-20 01:45:32 +08:00
**As of January 2023, the `develop` branch is officially in "Pre 4.3" mode. We envision several API-breaking changes as we switch to C++17 and away from boost.**
2023-09-04 10:47:16 +08:00
In addition, features deprecated in 4.2 will be removed. Please use the stable [4.2 release](https://github.com/borglab/gtsam/releases/tag/4.2) if you need those features. However, most are easily converted and can be tracked down (in 4.2) by disabling the cmake flag `GTSAM_ALLOW_DEPRECATED_SINCE_V42`.
2020-08-03 04:23:50 +08:00
## What is GTSAM?
2016-06-06 02:02:54 +08:00
2020-02-06 10:29:27 +08:00
GTSAM is a C++ library that implements smoothing and
mapping (SAM) in robotics and vision, using Factor Graphs and Bayes
Networks as the underlying computing paradigm rather than sparse
2016-06-06 02:02:54 +08:00
matrices.
The current support matrix is:
2025-04-17 06:34:00 +08:00
| Platform | Compiler | Build Status |
| :----------------: | :-------: | :------------------------------------------------------------------------------: |
| Ubuntu 22.04/24.04 | gcc/clang | ![Linux CI](https://github.com/borglab/gtsam/workflows/Linux%20CI/badge.svg) |
| macOS | clang | ![macOS CI](https://github.com/borglab/gtsam/workflows/macOS%20CI/badge.svg) |
| Windows | MSVC | ![Windows CI](https://github.com/borglab/gtsam/workflows/Windows%20CI/badge.svg) |
On top of the C++ library, GTSAM includes [wrappers for MATLAB & Python](#wrappers).
2016-06-06 02:02:54 +08:00
## Quickstart
2016-06-06 02:02:54 +08:00
In the root library folder execute:
```sh
2016-06-06 02:02:54 +08:00
#!bash
mkdir build
cd build
cmake ..
make check (optional, runs unit tests)
make install
2016-06-06 02:02:54 +08:00
```
Prerequisites:
2022-08-12 05:12:33 +08:00
- [Boost](http://www.boost.org/users/download/) >= 1.65 (Ubuntu: `sudo apt-get install libboost-all-dev`)
- [CMake](http://www.cmake.org/cmake/resources/software.html) >= 3.0 (Ubuntu: `sudo apt-get install cmake`)
2016-06-06 02:02:54 +08:00
- A modern compiler, i.e., at least gcc 4.7.3 on Linux.
Optional prerequisites - used automatically if findable by CMake:
- [Intel Threaded Building Blocks (TBB)](http://www.threadingbuildingblocks.org/) (Ubuntu: `sudo apt-get install libtbb-dev`)
2019-02-13 17:07:36 +08:00
- [Intel Math Kernel Library (MKL)](http://software.intel.com/en-us/intel-mkl) (Ubuntu: [installing using APT](https://software.intel.com/en-us/articles/installing-intel-free-libs-and-python-apt-repo))
2019-03-06 17:47:07 +08:00
- See [INSTALL.md](INSTALL.md) for more installation information
- Note that MKL may not provide a speedup in all cases. Make sure to benchmark your problem with and without MKL.
2016-06-06 02:02:54 +08:00
## GTSAM 4 Compatibility
2016-06-06 02:02:54 +08:00
2020-07-23 05:32:07 +08:00
GTSAM 4 introduces several new features, most notably Expressions and a Python toolbox. It also introduces traits, a C++ technique that allows optimizing with non-GTSAM types. That opens the door to retiring geometric types such as Point2 and Point3 to pure Eigen types, which we also do. A significant change which will not trigger a compile error is that zero-initializing of Point2 and Point3 is deprecated, so please be aware that this might render functions using their default constructor incorrect.
Merge remote-tracking branch 'origin/release/4.2' into develop # Conflicts: # .github/workflows/build-special.yml # CMakeLists.txt # README.md # cmake/HandleGeneralOptions.cmake # cmake/HandlePrintConfiguration.cmake # examples/Pose3Localization.cpp # examples/SolverComparer.cpp # gtsam/base/SymmetricBlockMatrix.h # gtsam/discrete/DecisionTree.h # gtsam/discrete/DiscreteFactorGraph.h # gtsam/discrete/DiscreteJunctionTree.h # gtsam/discrete/DiscreteValues.h # gtsam/discrete/discrete.i # gtsam/discrete/tests/testDecisionTreeFactor.cpp # gtsam/discrete/tests/testDiscreteBayesTree.cpp # gtsam/geometry/Pose3.cpp # gtsam/geometry/Pose3.h # gtsam/geometry/geometry.i # gtsam/hybrid/HybridGaussianFactorGraph.cpp # gtsam/hybrid/HybridNonlinearFactorGraph.cpp # gtsam/hybrid/HybridSmoother.cpp # gtsam/hybrid/HybridValues.h # gtsam/hybrid/hybrid.i # gtsam/hybrid/tests/testGaussianMixtureFactor.cpp # gtsam/hybrid/tests/testHybridGaussianFactorGraph.cpp # gtsam/inference/BayesTreeCliqueBase.h # gtsam/linear/NoiseModel.cpp # gtsam/linear/linear.i # gtsam/nonlinear/Expression-inl.h # gtsam/nonlinear/Values-inl.h # gtsam/nonlinear/Values.cpp # gtsam/nonlinear/Values.h # gtsam/nonlinear/tests/testValues.cpp # gtsam/sfm/ShonanAveraging.h # gtsam/slam/tests/testLago.cpp # gtsam/symbolic/symbolic.i # gtsam_unstable/examples/SmartRangeExample_plaza1.cpp # gtsam_unstable/examples/SmartRangeExample_plaza2.cpp # gtsam_unstable/nonlinear/BatchFixedLagSmoother.h # package.xml # python/gtsam/tests/test_DiscreteBayesTree.py # python/gtsam/tests/test_DsfTrackGenerator.py # tests/testGaussianISAM2.cpp # timing/timeCameraExpression.cpp # timing/timeLago.cpp
2025-05-19 09:56:16 +08:00
There is a flag `GTSAM_ALLOW_DEPRECATED_SINCE_V43` for newly deprecated methods since the 4.3 release, which is on by default, allowing anyone to just pull version 4.3 and compile.
2016-06-06 02:02:54 +08:00
## Wrappers
2020-09-21 21:04:17 +08:00
We provide support for [MATLAB](matlab/README.md) and [Python](python/README.md) wrappers for GTSAM. Please refer to the linked documents for more details.
2022-08-12 05:12:33 +08:00
## Citation
If you are using GTSAM for academic work, please use the following citation:
```bibtex
2022-08-12 05:12:33 +08:00
@software{gtsam,
2023-01-04 20:03:44 +08:00
author = {Frank Dellaert and GTSAM Contributors},
2022-08-12 05:12:33 +08:00
title = {borglab/gtsam},
2023-01-04 20:03:44 +08:00
month = May,
2022-08-12 05:12:33 +08:00
year = 2022,
2023-01-04 20:03:44 +08:00
publisher = {Georgia Tech Borg Lab},
version = {4.2a8},
2022-08-12 05:12:33 +08:00
doi = {10.5281/zenodo.5794541},
2023-01-04 20:03:44 +08:00
url = {https://github.com/borglab/gtsam)}}
2022-08-12 05:12:33 +08:00
}
```
2023-01-04 20:03:44 +08:00
To cite the `Factor Graphs for Robot Perception` book, please use:
```bibtex
2022-08-12 05:12:33 +08:00
@book{factor_graphs_for_robot_perception,
author={Frank Dellaert and Michael Kaess},
year={2017},
title={Factor Graphs for Robot Perception},
publisher={Foundations and Trends in Robotics, Vol. 6},
url={http://www.cs.cmu.edu/~kaess/pub/Dellaert17fnt.pdf}
}
2023-01-04 20:03:44 +08:00
```
2022-08-12 05:12:33 +08:00
2023-01-04 20:03:44 +08:00
If you are using the IMU preintegration scheme, please cite:
```bibtex
@book{imu_preintegration,
author={Christian Forster and Luca Carlone and Frank Dellaert and Davide Scaramuzza},
title={IMU preintegration on Manifold for Efficient Visual-Inertial Maximum-a-Posteriori Estimation},
year={2015}
}
2022-08-12 05:12:33 +08:00
```
## The Preintegrated IMU Factor
2016-06-06 02:02:54 +08:00
GTSAM includes a state of the art IMU handling scheme based on
2022-08-12 05:12:33 +08:00
- Todd Lupton and Salah Sukkarieh, _"Visual-Inertial-Aided Navigation for High-Dynamic Motion in Built Environments Without Initial Conditions"_, TRO, 28(1):61-76, 2012. [[link]](https://ieeexplore.ieee.org/document/6092505)
2016-06-06 02:02:54 +08:00
Our implementation improves on this using integration on the manifold, as detailed in
2022-08-12 05:12:33 +08:00
- Luca Carlone, Zsolt Kira, Chris Beall, Vadim Indelman, and Frank Dellaert, _"Eliminating conditionally independent sets in factor graphs: a unifying perspective based on smart factors"_, Int. Conf. on Robotics and Automation (ICRA), 2014. [[link]](https://ieeexplore.ieee.org/abstract/document/6907483)
- Christian Forster, Luca Carlone, Frank Dellaert, and Davide Scaramuzza, _"IMU Preintegration on Manifold for Efficient Visual-Inertial Maximum-a-Posteriori Estimation"_, Robotics: Science and Systems (RSS), 2015. [[link]](http://www.roboticsproceedings.org/rss11/p06.pdf)
2016-06-06 02:02:54 +08:00
If you are using the factor in academic work, please cite the publications above.
2022-08-12 05:12:33 +08:00
In GTSAM 4 a new and more efficient implementation, based on integrating on the NavState tangent space and detailed in [this document](doc/ImuFactor.pdf), is enabled by default. To switch to the RSS 2015 version, set the flag `GTSAM_TANGENT_PREINTEGRATION` to OFF.
2016-06-06 02:02:54 +08:00
## Additional Information
2016-06-06 02:02:54 +08:00
2018-06-12 06:29:02 +08:00
There is a [`GTSAM users Google group`](https://groups.google.com/forum/#!forum/gtsam-users) for general discussion.
Read about important [`GTSAM-Concepts`](GTSAM-Concepts.md) here. A primer on GTSAM Expressions,
which support (superfast) automatic differentiation,
can be found on the [GTSAM wiki on BitBucket](https://bitbucket.org/gtborg/gtsam/wiki/Home).
2016-06-06 02:02:54 +08:00
See the [`INSTALL`](INSTALL.md) file for more detailed installation instructions.
2016-06-06 02:02:54 +08:00
GTSAM is open source under the BSD license, see the [`LICENSE`](LICENSE) and [`LICENSE.BSD`](LICENSE.BSD) files.
Please see the [`examples/`](examples) directory and the [`USAGE`](USAGE.md) file for examples on how to use GTSAM.
GTSAM was developed in the lab of [Frank Dellaert](http://www.cc.gatech.edu/~dellaert) at the [Georgia Institute of Technology](http://www.gatech.edu), with the help of many contributors over the years, see [THANKS](THANKS.md).