gtsam
Georgia Tech Smoothing And Mapping library
What it is and what it does
GTSAM is a robotics and computer vision library centered on factor graphs—a graphical model representation that encodes optimization problems arising in simultaneous localization and mapping (SLAM), visual odometry, and sensor fusion. Rather than working directly with sparse matrices, GTSAM uses factor graphs and Bayes networks to express relationships between poses, landmarks, and measurements, then solves them via nonlinear optimization. The Python wrapper provides access to this C++ core, letting you build and solve factor graphs for problems like visual-inertial odometry (combining camera and IMU data), pose-graph optimization, and multi-robot localization.
The library includes specialized factors for IMU preintegration—a state-of-the-art scheme for fusing inertial measurements with visual or other pose constraints—and supports both batch and incremental solving. It is widely used in academic robotics research and production systems. Runtime dependencies are minimal (numpy and pyparsing), and prebuilt wheels are available for common platforms, though the compiled nature of the bindings means installation may require a C++ toolchain on some systems.
Use it for:
- Build and solve pose graphs for visual SLAM systems that fuse camera and IMU measurements
- Implement visual-inertial odometry (VIO) by preintegrating IMU data between keyframes
- Optimize multi-robot localization by adding relative pose constraints to a shared factor graph
- Refine camera calibration and landmark positions in structure-from-motion pipelines
- Prototype robotics perception algorithms that require nonlinear least-squares optimization over manifolds
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
GTSAM is a Python wrapper around a C++ library for smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks to solve optimization problems in localization, mapping, and visual-inertial estimation.
Yes, if you are working on robotics or computer vision research involving SLAM, visual odometry, or sensor fusion. The library is production-stable, actively maintained, and has no known vulnerabilities. Install friction is moderate due to compiled bindings, but prebuilt wheels for modern Python versions on common platforms mitigate this. The permissive BSD license poses no restrictions. Not necessary for general-purpose optimization or machine learning; consider it only if your problem naturally fits the factor-graph abstraction.
Install
gtsam on PyPI
pip
pip install gtsamuv
uv add gtsampoetry
poetry add gtsamInstalling gtsam
Before you install
Medium install friction due to compiled C++ bindings, but prebuilt wheels are available for modern Python versions (3.11–3.14) on macOS (x86_64 and arm64) and Linux (x86_64 and aarch64). Maintenance is active with a recent release.
License in practice
Permissive Simplified BSD license allows commercial and private use with minimal restrictions, making it suitable for proprietary robotics and vision projects.
Quickstart
pip install gtsam
import gtsam
import numpy as np
# Create a factor graph and add factors for optimization
graph = gtsam.NonlinearFactorGraph()
initial_estimate = gtsam.Values()
Requires a C++ compiler and build tools during wheel compilation if installing from source; prebuilt wheels avoid this for supported platforms.
Verify before relying
- Whether the Python wrapper exposes all C++ library features or a subset thereof
- Performance characteristics and scaling limits for large-scale SLAM problems
- Compatibility with specific robotics frameworks (ROS, etc.) beyond the core library
Package facts
| License | Simplified BSD license (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — numpy, pyparsing |
| Maintenance | actively maintained — 10 days since the last release |
| First released | |
| Downloads | 81,499/month — #14,223 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gtsam-4.2.2-cp311-cp311-macosx_10_15_x86_64.whl; gtsam-4.2.2-cp311-cp311-macosx_11_0_arm64.whl; gtsam-4.2.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; gtsam-4.2.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; gtsam-4.2.2-cp312-cp312-macosx_10_15_x86_64.whl; gtsam-4.2.2-cp312-cp312-macosx_11_0_arm64.whl; gtsam-4.2.2-cp312-cp312-manylinux_2_28_aarch64.whl; gtsam-4.2.2-cp312-cp312-manylinux_2_28_x86_64.whl; gtsam-4.2.2-cp313-cp313-macosx_10_15_x86_64.whl; gtsam-4.2.2-cp313-cp313-macosx_11_0_arm64.whl; gtsam-4.2.2-cp313-cp313-manylinux_2_28_aarch64.whl; gtsam-4.2.2-cp313-cp313-manylinux_2_28_x86_64.whl; gtsam-4.2.2-cp314-cp314-macosx_10_15_x86_64.whl; gtsam-4.2.2-cp314-cp314-macosx_11_0_arm64.whl; gtsam-4.2.2-cp314-cp314-manylinux_2_28_aarch64.whl; gtsam-4.2.2-cp314-cp314-manylinux_2_28_x86_64.whl
Keywords: slam, sam, robotics, localization, mapping, optimization
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
toppraComputes time-optimal path parameterization for…
permissive · top 15,000 on PyPI
rsl-rl-libRSL-RL is a GPU-accelerated reinforcement…
permissive · top 15,000 on PyPI
pykalmanpykalman provides Kalman filtering, smoothing,…
permissive · top 15,000 on PyPI
mjlabmjlab provides a GPU-accelerated reinforcement…
permissive · top 15,000 on PyPI
dex-retargetingTranslates human hand motion to robot hand…
permissive · top 15,000 on PyPI
umap-learnUMAP reduces high-dimensional data to lower…
permissive · top 5,000 on PyPI
onemkl-sycl-sparseProvides C and Data Parallel C++ (DPC++)…
unclear · top 15,000 on PyPI
mklIntel oneAPI Math Kernel Library provides…
unclear · top 15,000 on PyPI
simdkalmanImplements vectorized Kalman filters that run…
permissive · top 15,000 on PyPI
mplibMPlib provides motion planning algorithms for…
permissive · top 15,000 on PyPI