The slam
module provides a collection of factors, constraints, utilities, and initialization algorithms commonly used in Simultaneous Localization and Mapping (SLAM) and Structure from Motion (SfM) applications. It builds upon the core GTSAM inference engine (gtsam/inference
) and geometric types (gtsam/geometry
).
Core Factors¶
These are fundamental factor types often used as building blocks in SLAM.
- PriorFactor : A prior factor acting only on the rotation component of a pose variable.
- BetweenFactor : Represents relative measurements between two poses or other Lie group variables (e.g., derived from odometry).
Visual SLAM/SfM Factors¶
Factors specifically designed for visual data (camera measurements).
- GenericProjectionFactor : Standard monocular projection factor relating a 3D landmark, camera pose, and fixed calibration to a 2D measurement.
- GeneralSFMFactor : Projection factors used when camera calibration is unknown or optimized alongside poses and landmarks.
- StereoFactor : Standard stereo projection factor relating a 3D landmark, camera pose, and fixed stereo calibration to a
StereoPoint2
measurement. - EssentialMatrixFactor : Factors constraining poses or calibration based on the Essential matrix derived from calibrated cameras.
- EssentialMatrixConstraint : Factor constraining the relative pose between two cameras based on a measured Essential matrix.
- TriangulationFactor : Factor constraining a 3D point based on a measurement from a single known camera view, useful for triangulation.
- PlanarProjectionFactor : Projection factors specialized for robots moving on a 2D plane.
Smart Factors¶
Factors that implicitly manage landmark variables, marginalizing them out during optimization.
- SmartFactorParams : Configuration parameters controlling the behavior of smart factors (linearization, degeneracy handling, etc.).
- SmartProjectionFactor : Smart factor for monocular measurements where both camera pose and calibration are optimized.
- SmartProjectionPoseFactor : Smart factor for monocular measurements where camera calibration is fixed, optimizing only poses.
- SmartProjectionRigFactor : Smart factor for calibrated multi-camera rigs, optimizing only the rig’s body pose.
- SmartFactorBase : Abstract base class for smart factors (internal use).
Other Geometric Factors & Constraints¶
Factors representing various geometric relationships or constraints.
- PoseRotationPrior : A prior factor acting only on the rotation component of a pose variable.
- PoseTranslationPrior : A prior factor acting only on the translation component of a pose variable.
- OrientedPlane3Factor : Factors for estimating and constraining 3D planar landmarks (
OrientedPlane3
). - RotateFactor : Factors constraining an unknown rotation based on how it transforms measured rotations or directions.
- KarcherMeanFactor : Factor for constraining the Karcher mean (geometric average) of a set of rotations or other manifold values.
- FrobeniusFactor : Factors operating directly on rotation matrix entries using the Frobenius norm, an alternative to Lie algebra-based factors.
- ReferenceFrameFactor : Factor relating the same landmark observed in two different coordinate frames via an unknown transformation, useful for map merging.
- BoundingConstraint : Abstract base class for creating inequality constraints (e.g., keeping a variable within certain bounds). Requires C++ derivation.
- AntiFactor : A factor designed to negate the effect of another factor, useful for dynamically removing constraints.
Initialization & Utilities¶
Helper functions and classes for SLAM tasks.
- lago : Linear Approximation for Graph Optimization (LAGO) for initializing
Pose2
graphs. - InitializePose3 : Methods for initializing
Pose3
graphs by first solving for rotations, then translations. - dataset : Utility functions for loading/saving common SLAM dataset formats (g2o, TORO).
- expressions : Pre-defined Expression trees for common SLAM factor types (internal use for Expression-based factors).