29 using namespace gtsam;
34 std::make_shared<Cal3_S2>(1500, 1200, 0, 640, 480);
53 Factor factor(
camera1, z1, model, pointKey);
57 factor.evaluateError(
landmark, HActual);
59 Matrix HExpected = numericalDerivative11<Vector,Point3>(
67 TEST( triangulation, TriangulationFactorStereo ) {
77 Factor factor(camera2, z2, model, pointKey);
81 factor.evaluateError(
landmark, HActual);
83 Matrix HExpected = numericalDerivative11<Vector, Point3>(
92 nullptr, std::placeholders::_2);
101 vector<Matrix> HActual1(1), HActual2(1);
102 Vector error1 = factor.unwhitenedError(values, HActual1);
static Point2 project2(const CalibratedCamera &camera, const Point3 &point)
static int runAllTests(TestResult &result)
noiseModel::Diagonal::shared_ptr model
static const Rot3 upright
static const Point3 landmark(5, 0.5, 1.2)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Some functions to compute numerical derivatives.
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
const gtsam::Key pointKey
TEST(triangulation, TriangulationFactor)
Expressions for Block Automatic Differentiation.
Base class for all pinhole cameras.
static const Line3 l(Rot3(), 1, 1)
The most common 5DOF 3D->2D calibration, stereo version.
static const std::shared_ptr< Cal3_S2 > sharedCal
#define EXPECT(condition)
Functions for triangulation.
static const Camera2 camera2(pose1, K2)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Vector unwhitenedError(const Values &x, OptionalMatrixVecType H=nullptr) const override
Array< double, 1, 3 > e(1./3., 0.5, 2.)
StereoPoint2 project(const Point3 &point) const
Project 3D point to StereoPoint2 (uL,uR,v)
std::shared_ptr< Cal3_S2Stereo > shared_ptr
A Stereo Camera based on two Simple Cameras.
void insert(Key j, const Value &val)
PinholeCamera< Cal3_S2 > camera1(pose1, *sharedCal)
std::uint64_t Key
Integer nonlinear key type.
Calibration used by Bundler.
noiseModel::Base::shared_ptr SharedNoiseModel