31 using namespace gtsam;
79 auto noise_zero_info = noiseModel::Isotropic::Precision(6, 0.0);
102 Values initial = InitializePose3::computeOrientationsChordal(pose3Graph);
115 Values initial = InitializePose3::computeOrientationsChordal(pose3Graph);
131 InitializePose3::createSymbolicGraph(pose3Graph, &adjEdgesMap, &factorId2RotMap);
160 M(0,1) = -1;
M(1,0) = 1;
M(2,2) = 1;
162 double a = 6.010534238540223;
165 Vector actual = InitializePose3::gradientTron(R1, R2, a, b);
186 bool setRefFrame =
false;
187 Values orientations = InitializePose3::computeOrientationsGradient(pose3Graph, givenPoses, maxIter, setRefFrame);
189 Matrix M0 = (
Matrix(3,3) << 0.999435813876064, -0.033571481675497, 0.001004768630281,
190 0.033572116359134, 0.999436104312325, -0.000621610948719,
191 -0.000983333645009, 0.000654992453817, 0.999999302019670).finished();
195 Matrix M1 = (
Matrix(3,3) << 0.999905367545392, -0.010866391403031, 0.008436675399114,
196 0.010943459008004, 0.999898317528125, -0.009143047050380,
197 -0.008336465609239, 0.009234508232789, 0.999922610604863).finished();
201 Matrix M2 = (
Matrix(3,3) << 0.998936644682875, 0.045376417678595, -0.008158469732553,
202 -0.045306446926148, 0.998936408933058, 0.008566024448664,
203 0.008538487960253, -0.008187284445083, 0.999930028850403).finished();
207 Matrix M3 = (
Matrix(3,3) << 0.999898767273093, -0.010834701971459, 0.009223038487275,
208 0.010911315499947, 0.999906044037258, -0.008297366559388,
209 -0.009132272433995, 0.008397162077148, 0.999923041673329).finished();
226 bool setRefFrame =
false;
227 Values orientations = InitializePose3::computeOrientationsGradient(pose3Graph, givenPoses, 10, setRefFrame);
236 Values::shared_ptr matlabValues;
238 boost::tie(matlabGraph, matlabValues) =
readG2o(matlabResultsfile, is3D);
271 Values::shared_ptr posesInFile;
273 boost::tie(inputGraph, posesInFile) =
readG2o(g2oFile, is3D);
275 auto priorModel = noiseModel::Unit::Create(6);
Initialize Pose3 in a factor graph.
NonlinearFactorGraph graph()
Matrix< RealScalar, Dynamic, Dynamic > M
static int runAllTests(TestResult &result)
void insert(Key j, const Value &val)
Pose2_ Expmap(const Vector3_ &xi)
std::map< Key, Rot3 > KeyRotMap
IsDerived< DERIVEDFACTOR > add(boost::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
void g(const string &key, int i)
T compose(const T &t1, const T &t2)
Rot3 inverse() const
inverse of a rotation
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
string findExampleDataFile(const string &name)
std::map< Key, std::vector< size_t > > KeyVectorMap
boost::shared_ptr< This > shared_ptr
const ValueType at(Key j) const
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;Map< MatrixXf > M2(M1.data(), 6, 2)
#define EXPECT(condition)
static SharedNoiseModel model(noiseModel::Isotropic::Sigma(6, 0.1))
Array< double, 1, 3 > e(1./3., 0.5, 2.)
NonlinearFactorGraph graph2()
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Class between(const Class &g) const
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
Rot3 rotation(const Pose3 &pose, OptionalJacobian< 3, 6 > H)
GraphAndValues readG2o(const string &g2oFile, const bool is3D, KernelFunctionType kernelFunctionType)
This function parses a g2o file and stores the measurements into a NonlinearFactorGraph and the initi...
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
TEST(InitializePose3, buildPose3graph)
Values initialize(const NonlinearFactorGraph &graph, bool useOdometricPath)
utility functions for loading datasets
noiseModel::Base::shared_ptr SharedNoiseModel