doc/Code/OdometryExample.cpp
Go to the documentation of this file.
1 // Create an empty nonlinear factor graph
2 NonlinearFactorGraph graph;
3 
4 // Add a Gaussian prior on pose x_1
5 Pose2 priorMean(0.0, 0.0, 0.0);
6 noiseModel::Diagonal::shared_ptr priorNoise =
7  noiseModel::Diagonal::Sigmas(Vector3(0.3, 0.3, 0.1));
8 graph.addPrior(1, priorMean, priorNoise);
9 
10 // Add two odometry factors
11 Pose2 odometry(2.0, 0.0, 0.0);
12 noiseModel::Diagonal::shared_ptr odometryNoise =
13  noiseModel::Diagonal::Sigmas(Vector3(0.2, 0.2, 0.1));
14 graph.add(BetweenFactor<Pose2>(1, 2, odometry, odometryNoise));
15 graph.add(BetweenFactor<Pose2>(2, 3, odometry, odometryNoise));
noiseModel::Diagonal::shared_ptr odometryNoise
Eigen::Vector3d Vector3
Definition: Vector.h:43
NonlinearFactorGraph graph
Pose2 priorMean(0.0, 0.0, 0.0)
noiseModel::Diagonal::shared_ptr priorNoise
Pose2 odometry(2.0, 0.0, 0.0)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:43:05