32 using namespace gtsam;
37 static boost::shared_ptr<Cal3_S2Stereo>
K(
new Cal3_S2Stereo(625, 625, 0, 320, 240, 0.5));
53 TestStereoFactor factor(measurement,
model,
X(1),
L(1),
K);
59 Pose3 body_P_sensor(Rot3::RzRyRx(-M_PI_2, 0.0, -M_PI_2),
Point3(0.25, -0.10, 1.0));
61 TestStereoFactor factor(measurement,
model,
X(1),
L(1),
K, body_P_sensor);
79 Pose3 body_P_sensor(Rot3::RzRyRx(-M_PI_2, 0.0, -M_PI_2),
Point3(0.25, -0.10, 1.0));
81 TestStereoFactor
factor1(measurement,
model,
X(1),
L(1),
K, body_P_sensor);
82 TestStereoFactor
factor2(measurement,
model,
X(1),
L(1),
K, body_P_sensor);
91 TestStereoFactor factor(measurement,
model,
X(1),
L(1),
K);
111 Pose3 body_P_sensor(Rot3::RzRyRx(-M_PI_2, 0.0, -M_PI_2),
Point3(0.25, -0.10, 1.0));
112 TestStereoFactor factor(measurement,
model,
X(1),
L(1),
K, body_P_sensor);
132 TestStereoFactor factor(measurement,
model,
X(1),
L(1),
K);
139 Matrix H1Actual, H2Actual;
143 Matrix H1Expected = (
Matrix(3, 6) << 0.0, -625.0, 0.0, -100.0, 0.0, 0.0,
144 0.0, -625.0, 0.0, -100.0, 0.0, -8.0,
145 625.0, 0.0, 0.0, 0.0, -100.0, 0.0).finished();
148 0.0, 100.0, 0.0).finished();
159 Pose3 body_P_sensor(Rot3::RzRyRx(-M_PI_2, 0.0, -M_PI_2),
Point3(0.25, -0.10, 1.0));
160 TestStereoFactor factor(measurement,
model,
X(1),
L(1),
K, body_P_sensor);
167 Matrix H1Actual, H2Actual;
171 Matrix H1Expected = (
Matrix(3, 6) << -100.0, 0.0, 650.0, 0.0, 100.0, 0.0,
172 -100.0, -8.0, 649.2, -8.0, 100.0, 0.0,
173 -10.0, -650.0, 0.0, 0.0, 0.0, 100.0).finished();
176 0.0, 0.0, -100.0).finished();
199 values.insert(
L(1), l1);
virtual const Values & optimize()
static int runAllTests(TestResult &result)
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
#define DOUBLES_EQUAL(expected, actual, threshold)
NonlinearFactorGraph graph
GenericStereoFactor< Pose3, Point3 > TestStereoFactor
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&...args)
Emplace a shared pointer to factor of given type.
static SharedNoiseModel model(noiseModel::Unit::Create(3))
static Pose3 camera1(Rot3(Vector3(1,-1,-1).asDiagonal()), Point3(0, 0, 6.25))
static const Pose3 pose(Rot3(Vector3(1,-1,-1).asDiagonal()), Point3(0, 0, 0.5))
Array< double, 1, 3 > e(1./3., 0.5, 2.)
double error() const
return error in current optimizer state
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
The most common 5DOF 3D->2D calibration + Stereo baseline.
Vector evaluateError(const Pose3 &pose, const Point3 &point, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
GaussianFactorGraph::shared_ptr iterate() override
A Stereo Camera based on two Simple Cameras.
JacobianFactor factor2(keyX, A21, keyY, A22, b2, noiseModel::Isotropic::Sigma(2, sigma2))
static boost::shared_ptr< Cal3_S2Stereo > K(new Cal3_S2Stereo(625, 625, 0, 320, 240, 0.5))
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
TEST(StereoFactor, Constructor)
noiseModel::Base::shared_ptr SharedNoiseModel
JacobianFactor factor1(keyX, A11, b1, noiseModel::Isotropic::Sigma(2, sigma1))