27 using namespace gtsam;
30 std::random_device rd;
31 std::mt19937 e2(rd());
32 std::uniform_real_distribution<> dist(0, 1);
35 for (
int i = 0;
i < numberNodes; ++
i) {
38 r = (r - 0.5) / 10 +
i;
39 M << 1, 0, 0, r, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1;
40 poses.push_back(
Pose3(M));
44 auto priorModel = noiseModel::Isotropic::Variance(6, 1
e-4);
46 first_M << 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1;
53 auto VOCovarianceModel = noiseModel::Isotropic::Variance(6, 1
e-3);
57 vo_M << 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1;
58 Pose3 relativeMotion(vo_M);
59 for (
int i = 0;
i < numberNodes - 1; ++
i) {
66 for (
int i = 0;
i < numberNodes; ++
i) {
79 int numberNodes = stoi(argv[1]);
80 cout <<
"number of_nodes: " << numberNodes << endl;
Matrix< RealScalar, Dynamic, Dynamic > M
void setLinearSolverType(const std::string &solver)
virtual const Values & optimize()
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
int main(int args, char *argv[])
void insert(Key j, const Value &val)
void testGtsam(int numberNodes)
IsDerived< DERIVEDFACTOR > add(boost::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
NonlinearFactorGraph graph
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
constexpr int first(int i)
Implementation details for constexpr functions.
void setVerbosity(const std::string &src)
void setOrderingType(const std::string &ordering)
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static SmartStereoProjectionParams params
The most common 5DOF 3D->2D calibration + Stereo baseline.