gtsam/examples
Frank Dellaert 555a2173a3 Don't optimize every time 2025-01-30 10:58:28 -05:00
..
Data matlab script to plot results for City10000 2025-01-22 19:56:40 -05:00
CMakeLists.txt update gtsamAddExamplesGlob and gtsamAddTimingGlob to take an additional argument rather than using a global variable 2023-10-08 12:16:24 -04:00
CameraResectioning.cpp remove make_shared header 2023-01-22 08:40:02 -08:00
CombinedImuFactorsExample.cpp Cleanup some includes and fix cassert 2024-12-11 14:05:05 -05:00
CreateSFMExampleData.cpp
DiscreteBayesNetExample.cpp Get rid of all (pre c++11) += calls to create Orderings. 2023-02-05 20:45:54 -08:00
DiscreteBayesNet_FG.cpp
EssentialViewGraphExample.cpp Differentiated EssentialTransferFactor and EssentialTransferFactorK 2024-11-05 15:55:06 -05:00
FisheyeExample.cpp shared_ptr, make_shared, allocate_shared 2023-01-22 08:40:02 -08:00
GNCExample.cpp Modify GNC example, add comments to explain example purpose 2023-09-11 18:01:21 -04:00
HMMExample.cpp
Hybrid_City10000.cpp Don't optimize every time 2025-01-30 10:58:28 -05:00
IMUKittiExampleGPS.cpp Fixing strength of bias constraints in IMUKittiExampleGPS.cpp 2024-03-18 08:47:11 +01:00
ISAM2Example_SmartFactor.cpp Use c++17 in examples 2023-02-04 10:35:42 -08:00
ISAM2_City10000.cpp human-friendly time printing 2025-01-30 10:58:28 -05:00
ImuFactorsExample.cpp Cleanup some includes and fix cassert 2024-12-11 14:05:05 -05:00
ImuFactorsExample2.cpp shared_ptr, make_shared, allocate_shared 2023-01-22 08:40:02 -08:00
InverseKinematicsExampleExpressions.cpp
LocalizationExample.cpp replaced casts 2023-01-22 08:40:02 -08:00
METISOrderingExample.cpp
OdometryExample.cpp
PlanarSLAMExample.cpp
Pose2SLAMExample.cpp
Pose2SLAMExampleExpressions.cpp
Pose2SLAMExample_g2o.cpp global find/replace. Does not compile 2023-01-23 18:26:44 -08:00
Pose2SLAMExample_graph.cpp global find/replace. Does not compile 2023-01-23 18:26:44 -08:00
Pose2SLAMExample_graphviz.cpp
Pose2SLAMExample_lago.cpp global find/replace. Does not compile 2023-01-23 18:26:44 -08:00
Pose2SLAMStressTest.cpp
Pose2SLAMwSPCG.cpp shared_ptr, make_shared, allocate_shared 2023-01-22 08:40:02 -08:00
Pose3Localization.cpp Use c++17 in examples 2023-02-04 10:35:42 -08:00
Pose3SLAMExampleExpressions_BearingRangeWithTransform.cpp
Pose3SLAMExample_changeKeys.cpp global find/replace. Does not compile 2023-01-23 18:26:44 -08:00
Pose3SLAMExample_g2o.cpp global find/replace. Does not compile 2023-01-23 18:26:44 -08:00
Pose3SLAMExample_initializePose3Chordal.cpp global find/replace. Does not compile 2023-01-23 18:26:44 -08:00
Pose3SLAMExample_initializePose3Gradient.cpp global find/replace. Does not compile 2023-01-23 18:26:44 -08:00
README.md
RangeISAMExample_plaza2.cpp remove all adaptors 2023-01-23 18:28:55 -08:00
SFMExample.cpp Switch to general F 2024-10-25 07:34:42 -07:00
SFMExampleExpressions.cpp
SFMExampleExpressions_bal.cpp Merge branch 'develop' into feaure/remove_misc_boost 2023-02-05 10:43:34 -08:00
SFMExample_SmartFactor.cpp replaced casts 2023-01-22 08:40:02 -08:00
SFMExample_SmartFactorPCG.cpp updat example 2024-10-15 23:43:56 -04:00
SFMExample_bal.cpp Merge branch 'develop' into feaure/remove_misc_boost 2023-02-05 10:43:34 -08:00
SFMExample_bal_COLAMD_METIS.cpp Merge branch 'develop' into feaure/remove_misc_boost 2023-02-05 10:43:34 -08:00
SFMdata.h Fix createPoses 2024-10-28 08:55:49 -07:00
SelfCalibrationExample.cpp
ShonanAveragingCLI.cpp global find/replace. Does not compile 2023-01-23 18:26:44 -08:00
SimpleRotation.cpp
SolverComparer.cpp Use c++17 in examples 2023-02-04 10:35:42 -08:00
StereoVOExample.cpp
StereoVOExample_large.cpp
TimeTBB.cpp
TriangulationLOSTExample.cpp Fix GCC 13 build issues 2025-01-22 17:10:47 -05:00
UGM_chain.cpp
UGM_small.cpp
ViewGraphExample.cpp Switch to using Cal3f 2024-10-28 15:59:19 -07:00
VisualISAM2Example.cpp
VisualISAMExample.cpp
easyPoint2KalmanFilter.cpp
elaboratePoint2KalmanFilter.cpp Cleanup some includes and fix cassert 2024-12-11 14:05:05 -05:00
plot_city10000.m improved plotting script 2025-01-25 00:59:02 -05:00

README.md

GTSAM Examples

This directory contains all GTSAM C++ examples GTSAM pertaining to SFM

Basic Examples:

  • SimpleRotation: a simple example of optimizing a single rotation according to a single prior
  • CameraResectioning: resection camera from some known points
  • SFMExample: basic structure from motion
  • SFMExample_bal: same, but read data from read from BAL file
  • SelfCalibrationExample: Do SFM while also optimizing for calibration

Stereo Visual Odometry Examples

Visual odometry using a stereo rig:

  • StereoVOExample: basic example of stereo VO
  • StereoVOExample_large: larger, with a snippet of Kitti data

More Advanced Examples

The following examples illustrate some concepts from Georgia Tech's research papers, listed in the references section at the end:

  • VisualISAMExample: uses iSAM [TRO08]
  • VisualISAM2Example: uses iSAM2 [IJRR12]
  • SFMExample_SmartFactor: uses smartFactors [ICRA14]

Kalman Filter Examples

  • elaboratePoint2KalmanFilter: simple linear Kalman filter on a moving 2D point, but done using factor graphs
  • easyPoint2KalmanFilter: uses the generic templated Kalman filter class to do the same
  • fullStateKalmanFilter: simple 1D example with a full-state filter
  • errorStateKalmanFilter: simple 1D example of a moving target measured by a accelerometer, incl. drift-rate bias

2D Pose SLAM

  • LocalizationExample.cpp: modeling robot motion
  • Pose2SLAMExample: A 2D Pose SLAM example using the predefined typedefs in gtsam/slam/pose2SLAM.h
  • Pose2SLAMExample_advanced: same, but uses an Optimizer object
  • Pose2SLAMwSPCG: solve a simple 3 by 3 grid of Pose2 SLAM problem by using easy SPCG interface

Planar SLAM with landmarks

  • PlanarSLAMExample: simple robotics example using the pre-built planar SLAM domain
  • PlanarSLAMExample_selfcontained: simple robotics example with all typedefs internal to this script.

Visual SLAM

The directory vSLAMexample includes 2 simple examples using GTSAM:

  • vSFMexample using visual SLAM for structure-from-motion (SFM)
  • vISAMexample using visual SLAM and ISAM for incremental SLAM updates

See the separate README file there.

Undirected Graphical Models (UGM)

The best representation for a Markov Random Field is a factor graph :-) This is illustrated with some discrete examples from the UGM MATLAB toolbox, which can be found at http://www.di.ens.fr/~mschmidt/Software/UGM

Building and Running

To build, cd into the top-level gtsam directory and do:

mkdir build
cd build
cmake ..

For each .cpp file in this directory two make targets are created, one to build the executable, and one to build and run it. For example, the file CameraResectioning.cpp contains simple example to resection a camera from 4 known points. You can build it using

make CameraResectioning

or build and run it immediately with

make CameraResectioning.run

which should output:

Final result:
Values with 1 values:
Value x1: R:
[
           1,	         0.0,	         0.0,	
         0.0,	          -1,	         0.0,	
         0.0,	         0.0,	          -1,	
];
t: [0, 0, 2]';

References