gtsam/examples
Frank Dellaert 99a97da5f7 Fix examples 2022-01-21 18:12:38 -05:00
..
Data removing Sampson error + some tests cleanup 2021-06-14 01:30:00 +00:00
CMakeLists.txt Remove gtsam_unstable lib from examples 2021-01-18 14:47:39 -05:00
CameraResectioning.cpp Fix all new gcc warnings/errors: make explicit virtual/override methods. 2020-07-26 11:20:42 +02:00
CombinedImuFactorsExample.cpp Correct ImuFactorExamples frame description 2021-05-28 21:00:34 +01:00
CreateSFMExampleData.cpp formatting example 2021-06-20 22:26:19 -07:00
DiscreteBayesNetExample.cpp Fix examples 2022-01-21 18:12:38 -05:00
DiscreteBayesNet_FG.cpp Fix examples 2022-01-21 18:12:38 -05:00
FisheyeExample.cpp Use non-deprecated graphviz methods 2021-12-21 10:17:36 -05:00
HMMExample.cpp Fix examples 2022-01-21 18:12:38 -05:00
IMUKittiExampleGPS.cpp replace static variable with variable of greater scope in cpp example 2021-10-21 18:42:46 -04:00
ISAM2Example_SmartFactor.cpp Replace addPrior<> with addPrior 2020-04-12 13:10:09 -04:00
ImuFactorsExample.cpp Correct ImuFactorExamples frame description 2021-05-28 21:00:34 +01:00
ImuFactorsExample2.cpp renamed ImuFactorExample2 to be more consistent with naming 2020-08-11 00:26:34 -05:00
InverseKinematicsExampleExpressions.cpp Remove any unnecessary PriorFactor.h includes 2020-04-12 13:42:02 -04:00
LocalizationExample.cpp update: use avialble rot2 class 2021-03-23 16:13:13 +01:00
METISOrderingExample.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
OdometryExample.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
PlanarSLAMExample.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
Pose2SLAMExample.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
Pose2SLAMExampleExpressions.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
Pose2SLAMExample_g2o.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
Pose2SLAMExample_graph.cpp Replace addPrior<> with addPrior 2020-04-12 13:10:09 -04:00
Pose2SLAMExample_graphviz.cpp Use non-deprecated graphviz methods 2021-12-21 10:17:36 -05:00
Pose2SLAMExample_lago.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
Pose2SLAMStressTest.cpp Replace addPrior<> with addPrior 2020-04-12 13:10:09 -04:00
Pose2SLAMwSPCG.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
Pose3Localization.cpp Removed reference for iterating over values. Also used auto where I could, when changing. 2021-01-04 20:46:16 -05:00
Pose3SLAMExampleExpressions_BearingRangeWithTransform.cpp remove trailing spaces 2019-02-11 10:58:34 -05:00
Pose3SLAMExample_changeKeys.cpp Removed reference for iterating over values. Also used auto where I could, when changing. 2021-01-04 20:46:16 -05:00
Pose3SLAMExample_g2o.cpp Removed reference for iterating over values. Also used auto where I could, when changing. 2021-01-04 20:46:16 -05:00
Pose3SLAMExample_initializePose3Chordal.cpp Removed reference for iterating over values. Also used auto where I could, when changing. 2021-01-04 20:46:16 -05:00
Pose3SLAMExample_initializePose3Gradient.cpp Removed reference for iterating over values. Also used auto where I could, when changing. 2021-01-04 20:46:16 -05:00
README.md Small clarification and md cleanup 2021-08-21 17:04:33 -04:00
RangeISAMExample_plaza2.cpp Replace addPrior<> with addPrior 2020-04-12 13:10:09 -04:00
SFMExample.cpp Explicit type definition to handle warning 2020-07-10 23:01:18 -04:00
SFMExampleExpressions.cpp replaced/appended all calls to SimpleCamera with PinholeCameraCal3_S2 2020-02-21 19:42:55 -05:00
SFMExampleExpressions_bal.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
SFMExample_SmartFactor.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
SFMExample_SmartFactorPCG.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
SFMExample_bal.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
SFMExample_bal_COLAMD_METIS.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
SFMdata.h replaced/appended all calls to SimpleCamera with PinholeCameraCal3_S2 2020-02-21 19:42:55 -05:00
SelfCalibrationExample.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
ShonanAveragingCLI.cpp fixed typo 2020-12-05 14:34:35 -05:00
SimpleRotation.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
SolverComparer.cpp Removed reference for iterating over values. Also used auto where I could, when changing. 2021-01-04 20:46:16 -05:00
StereoVOExample.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
StereoVOExample_large.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
TimeTBB.cpp change to more efficient call of threaded functions 2020-05-06 16:47:16 -04:00
UGM_chain.cpp Fix examples 2022-01-21 18:12:38 -05:00
UGM_small.cpp Fix examples 2022-01-21 18:12:38 -05:00
VisualISAM2Example.cpp Replace addPrior<> with addPrior 2020-04-12 13:10:09 -04:00
VisualISAMExample.cpp Reformatted some and use of auto 2020-05-09 19:08:31 -04:00
easyPoint2KalmanFilter.cpp Change PriorFactor includes from gtsam/slam to gtsam/nonlinear 2020-04-10 22:26:22 -04:00
elaboratePoint2KalmanFilter.cpp Change PriorFactor includes from gtsam/slam to gtsam/nonlinear 2020-04-10 22:26:22 -04: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
  • LocalizationExample2.cpp: example with GPS like measurements
  • 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