LiuZe 3b51f35e80 base commit 1 gadu atpakaļ
..
Data 3b51f35e80 base commit 1 gadu atpakaļ
CMakeLists.txt 3b51f35e80 base commit 1 gadu atpakaļ
CameraResectioning.cpp 3b51f35e80 base commit 1 gadu atpakaļ
CombinedImuFactorsExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
CreateSFMExampleData.cpp 3b51f35e80 base commit 1 gadu atpakaļ
DiscreteBayesNetExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
DiscreteBayesNet_FG.cpp 3b51f35e80 base commit 1 gadu atpakaļ
FisheyeExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
HMMExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
IMUKittiExampleGPS.cpp 3b51f35e80 base commit 1 gadu atpakaļ
ISAM2Example_SmartFactor.cpp 3b51f35e80 base commit 1 gadu atpakaļ
ImuFactorsExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
ImuFactorsExample2.cpp 3b51f35e80 base commit 1 gadu atpakaļ
InverseKinematicsExampleExpressions.cpp 3b51f35e80 base commit 1 gadu atpakaļ
LocalizationExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
METISOrderingExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
OdometryExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
PlanarSLAMExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose2SLAMExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose2SLAMExampleExpressions.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose2SLAMExample_g2o.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose2SLAMExample_graph.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose2SLAMExample_graphviz.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose2SLAMExample_lago.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose2SLAMStressTest.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose2SLAMwSPCG.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose3Localization.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose3SLAMExampleExpressions_BearingRangeWithTransform.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose3SLAMExample_changeKeys.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose3SLAMExample_g2o.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose3SLAMExample_initializePose3Chordal.cpp 3b51f35e80 base commit 1 gadu atpakaļ
Pose3SLAMExample_initializePose3Gradient.cpp 3b51f35e80 base commit 1 gadu atpakaļ
README.md 3b51f35e80 base commit 1 gadu atpakaļ
RangeISAMExample_plaza2.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SFMExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SFMExampleExpressions.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SFMExampleExpressions_bal.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SFMExample_SmartFactor.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SFMExample_SmartFactorPCG.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SFMExample_bal.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SFMExample_bal_COLAMD_METIS.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SFMdata.h 3b51f35e80 base commit 1 gadu atpakaļ
SelfCalibrationExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
ShonanAveragingCLI.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SimpleRotation.cpp 3b51f35e80 base commit 1 gadu atpakaļ
SolverComparer.cpp 3b51f35e80 base commit 1 gadu atpakaļ
StereoVOExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
StereoVOExample_large.cpp 3b51f35e80 base commit 1 gadu atpakaļ
TimeTBB.cpp 3b51f35e80 base commit 1 gadu atpakaļ
UGM_chain.cpp 3b51f35e80 base commit 1 gadu atpakaļ
UGM_small.cpp 3b51f35e80 base commit 1 gadu atpakaļ
VisualISAM2Example.cpp 3b51f35e80 base commit 1 gadu atpakaļ
VisualISAMExample.cpp 3b51f35e80 base commit 1 gadu atpakaļ
easyPoint2KalmanFilter.cpp 3b51f35e80 base commit 1 gadu atpakaļ
elaboratePoint2KalmanFilter.cpp 3b51f35e80 base commit 1 gadu atpakaļ

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