25 using namespace gtsam;
33 StereoPoint2 a(1, 2, 3),
b(4, 5, 6),
c(5, 7, 9),
d(3, 3, 3);
60 Point3 one_meter_z(0, 0, 1);
61 Pose3 camPose3(unit, one_meter_z);
69 Pose3 camPose4(right, one_meter_z);
116 #ifdef GTSAM_THROW_CHEIRALITY_EXCEPTION 118 #else // otherwise project should not throw the exception 139 Rot3 R(0.589511291, -0.804859792, 0.0683931805,
140 -0.804435942, -0.592650676, -0.0405925523,
141 0.0732045588, -0.0310882277, -0.996832359);
142 Point3 t(53.5239823, 23.7866016, -4.42379876);
162 Point3 expected_point(1.2, 2.3, 4.5);
165 Matrix actual_jacobian_1, actual_jacobian_2;
166 Point3 actual_point = stereoCam2.
backproject2(stereo_point, actual_jacobian_1, actual_jacobian_2);
178 Rot3 R(0.589511291, -0.804859792, 0.0683931805,
179 -0.804435942, -0.592650676, -0.0405925523,
180 0.0732045588, -0.0310882277, -0.996832359);
181 Point3 t(53.5239823, 23.7866016, -4.42379876);
186 Matrix actual_jacobian_1, actual_jacobian_2;
static Point2 project(const Pose3 &pose, const Unit3 &pointAtInfinity, const Cal3_S2::shared_ptr &cal)
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
Rot2 R(Rot2::fromAngle(0.1))
Some functions to compute numerical derivatives.
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative31(boost::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
#define CHECK_EXCEPTION(condition, exception_name)
static Point3 landmark(0, 0, 5)
static const Cal3Bundler K2(625, 1e-3, 1e-3)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative32(boost::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
static const Line3 l(Rot3(), 1, 1)
boost::shared_ptr< Cal3_S2Stereo > shared_ptr
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.)
StereoPoint2 project2(const Point3 &point, OptionalJacobian< 3, 6 > H1=boost::none, OptionalJacobian< 3, 3 > H2=boost::none) const
static Cal3_S2Stereo::shared_ptr K(new Cal3_S2Stereo(1500, 1500, 0, 320, 240, 0.5))
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
#define GTSAM_CONCEPT_MANIFOLD_INST(T)
A Stereo Camera based on two Simple Cameras.
static Pose3 camPose(Rot3((Matrix3()<< 1., 0., 0., 0.,-1., 0., 0., 0.,-1.).finished()), Point3(0, 0, 6.25))
static Point3 backproject3(const Pose3 &pose, const StereoPoint2 &point, const Cal3_S2Stereo &K)
StereoPoint2 project(const Point3 &point) const
Project 3D point to StereoPoint2 (uL,uR,v)
static const CalibratedCamera camera(kDefaultPose)
TEST(StereoCamera, operators)
Point3 backproject2(const StereoPoint2 &z, OptionalJacobian< 3, 6 > H1=boost::none, OptionalJacobian< 3, 3 > H2=boost::none) const
static StereoPoint2 project3(const Pose3 &pose, const Point3 &point, const Cal3_S2Stereo &K)
#define GTSAM_CONCEPT_TESTABLE_INST(T)
static StereoCamera stereoCam(camPose, K)
Point3 backproject(const StereoPoint2 &z) const
back-project a measurement