Go to the documentation of this file.
13 using namespace gtsam;
19 const double radius = 1.0;
20 for (
int i = 0;
i < 3; ++
i) {
21 double angle =
i * 2.0 *
M_PI / 3.0;
22 double c =
cos(angle),
s =
sin(angle);
33 std::array<SimpleFundamentalMatrix, 3>
F;
34 for (
size_t i = 0;
i < 3; ++
i) {
35 size_t j = (
i + 1) % 3;
38 F[
i] = {
E, 1000.0, 1000.0,
Point2(640 / 2, 480 / 2),
41 return {
F[0],
F[1],
F[2]};
64 EXPECT(assert_equal<Matrix3>(
triplet.Fbc.matrix().transpose(), Fkj));
75 std::array<Point2, 3>
p;
76 for (
size_t i = 0;
i < 3; ++
i) {
83 EdgeKey key01(0, 1), key12(1, 2), key20(2, 0);
85 factor0{key01, key20,
p[1],
p[2],
p[0]},
109 const size_t numPoints = 5;
110 std::vector<Point3> points3D;
111 std::vector<std::array<Point2, 3>> projectedPoints;
114 for (
size_t n = 0;
n < numPoints; ++
n) {
116 points3D.push_back(
P);
118 std::array<Point2, 3>
p;
119 for (
size_t i = 0;
i < 3; ++
i) {
124 projectedPoints.push_back(
p);
128 EdgeKey key01(0, 1), key12(1, 2), key20(2, 0);
129 std::vector<std::tuple<Point2, Point2, Point2>> tuples;
131 for (
size_t n = 0;
n < numPoints; ++
n) {
132 const auto&
p = projectedPoints[
n];
133 tuples.emplace_back(
p[1],
p[2],
p[0]);
150 EXPECT(assert_equal<Vector>(Vector::Zero(2 * numPoints),
error, 1
e-9));
static int runAllTests(TestResult &result)
#define EXPECT_CORRECT_FACTOR_JACOBIANS(factor, values, numerical_derivative_step, tolerance)
Check the Jacobians produced by a factor against finite differences.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
#define EXPECT_LONGS_EQUAL(expected, actual)
Jet< T, N > sin(const Jet< T, N > &f)
#define EXPECT(condition)
std::array< Pose3, 3 > generateCameraPoses()
Generate three cameras on a circle, looking in.
const Cal3_S2 K(focalLength, focalLength, 0.0, principalPoint.x(), principalPoint.y())
TripleF< SimpleFundamentalMatrix > generateTripleF(const std::array< Pose3, 3 > &cameraPoses)
Jet< T, N > cos(const Jet< T, N > &f)
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
const Point3 & translation(OptionalJacobian< 3, 6 > Hself={}) const
get translation
Evaluate derivatives of a nonlinear factor numerically.
Point2 principalPoint(640/2, 480/2)
void insert(Key j, const Vector &value)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
std::array< Pose3, 3 > cameraPoses
const Rot3 & rotation(OptionalJacobian< 3, 6 > Hself={}) const
get rotation
std::pair< Matrix3, Matrix3 > getMatrices(const F &F1, const F &F2) const
TEST(SmartFactorBase, Pinhole)
static const Eigen::MatrixBase< Vector2 >::ConstantReturnType Z_2x1
The most common 5DOF 3D->2D calibration.
A simple camera class with a Cal3_S2 calibration.
Represents a 3D point on a unit sphere.
static const CalibratedCamera camera(kDefaultPose)
Point2 project(const Point3 &point, OptionalJacobian< 2, 6 > Dcamera={}, OptionalJacobian< 2, 3 > Dpoint={}) const
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:41:51