32 using namespace gtsam;
39 auto measurementNoise = noiseModel::Isotropic::Sigma(2, 1.0);
56 for (
size_t i = 0;
i < poses.size(); ++
i)
59 for (
size_t j = 0;
j < points.size(); ++
j)
69 static Pose3 kDeltaPose(Rot3::Rodrigues(-0.1, 0.2, 0.25),
70 Point3(0.05, -0.10, 0.20));
77 static auto kPosePrior = noiseModel::Diagonal::Sigmas(
78 (
Vector(6) << Vector3::Constant(0.1), Vector3::Constant(0.3))
83 static auto kPointPrior = noiseModel::Isotropic::Sigma(3, 0.1);
88 static Point3 kDeltaPoint(-0.25, 0.20, 0.15);
89 for (
size_t j = 0;
j < points.size(); ++
j)
95 isam.
update(graph, initialEstimate);
105 initialEstimate.
clear();
111 for (
size_t j = 0;
j < points.size(); ++
j)
const gtsam::Symbol key('X', 0)
static const Eigen::internal::all_t all
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
static int runAllTests(TestResult &result)
TEST(testVisualISAM2, all)
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
const ValueType at(Key j) const
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
virtual ISAM2Result update(const NonlinearFactorGraph &newFactors=NonlinearFactorGraph(), const Values &newTheta=Values(), const FactorIndices &removeFactorIndices=FactorIndices(), const std::optional< FastMap< Key, int > > &constrainedKeys={}, const std::optional< FastList< Key > > &noRelinKeys={}, const std::optional< FastList< Key > > &extraReelimKeys={}, bool force_relinearize=false)
NonlinearFactorGraph graph
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
std::vector< gtsam::Point3 > createPoints()
static Point2 measurement(323.0, 240.0)
Point2 project(const Point3 &pw, OptionalJacobian< 2, 6 > Dpose={}, OptionalJacobian< 2, 3 > Dpoint={}, OptionalJacobian< 2, DimK > Dcal={}) const
project a 3D point from world coordinates into the image
std::shared_ptr< Cal3_S2 > shared_ptr
Incremental update functionality (ISAM2) for BayesTree, with fluid relinearization.
#define EXPECT(condition)
NonlinearISAM isam(relinearizeInterval)
The most common 5DOF 3D->2D calibration.
Reprojection of a LANDMARK to a 2D point.
static ConjugateGradientParameters parameters
RelinearizationThreshold relinearizeThreshold
virtual void resize(size_t size)
#define EXPECT_LONGS_EQUAL(expected, actual)
Simple example for the structure-from-motion problems.
void insert(Key j, const Value &val)
static const CalibratedCamera camera(kDefaultPose)
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Values calculateEstimate() const
std::vector< gtsam::Pose3 > createPoses(const gtsam::Pose3 &init=gtsam::Pose3(gtsam::Rot3::Ypr(M_PI/2, 0,-M_PI/2), gtsam::Point3(30, 0, 0)), const gtsam::Pose3 &delta=gtsam::Pose3(gtsam::Rot3::Ypr(0,-M_PI/4, 0), gtsam::Point3(sin(M_PI/4) *30, 0, 30 *(1-sin(M_PI/4)))), int steps=8)