gtsam
Loading...
Searching...
No Matches
OrientedPlane3Factor.h
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
12/*
13 * @file OrientedPlane3Factor.cpp
14 * @brief OrientedPlane3 Factor class
15 * @author Alex Trevor
16 * @date December 22, 2013
17 */
18
19#pragma once
20
21#include <gtsam/geometry/OrientedPlane3.h>
24
25namespace gtsam {
26
30class GTSAM_EXPORT OrientedPlane3Factor
31 : public NoiseModelFactorT<Vector3, Pose3, OrientedPlane3> {
32 protected:
33 OrientedPlane3 measured_p_;
35
36 public:
37
38 // Provide access to the Matrix& version of evaluateError:
40
44 ~OrientedPlane3Factor() override {}
45
53 OrientedPlane3Factor(const Vector4& z, const SharedGaussian& noiseModel,
54 Key poseKey, Key landmarkKey)
55 : Base(noiseModel, poseKey, landmarkKey), measured_p_(z) {}
56
58 void print(const std::string& s = "OrientedPlane3Factor",
59 const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
60
62 Vector3 evaluateError(
63 const Pose3& pose, const OrientedPlane3& plane,
64 OptionalMatrixType H1, OptionalMatrixType H2) const override;
65};
66
67// TODO: Convert this factor to dimension two, three dimensions is redundant for direction prior
68class GTSAM_EXPORT OrientedPlane3DirectionPrior : public NoiseModelFactorN<OrientedPlane3> {
69 protected:
70 OrientedPlane3 measured_p_;
72
73 public:
74
75 // Provide access to the Matrix& version of evaluateError:
77
82
85 const SharedGaussian& noiseModel)
86 : Base(noiseModel, key), measured_p_(z) {}
87
89 void print(const std::string& s = "OrientedPlane3DirectionPrior",
90 const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
91
93 bool equals(const NonlinearFactor& expected, double tol = 1e-9) const override;
94
95 Vector evaluateError(const OrientedPlane3& plane, OptionalMatrixType H) const override;
96};
97
98} // gtsam
Base class for noise model factors with N variables.
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition Key.cpp:30
Matrix * OptionalMatrixType
This typedef will be used everywhere boost::optional<Matrix&> reference was used previously.
Definition NonlinearFactor.h:57
NoiseModelFactorT< Vector, ValueTypes... > NoiseModelFactorN
Noise model factor with N value types and dynamic-sized error vector.
Definition NoiseModelFactorN.h:561
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition Key.h:35
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
All noise models live in the noiseModel namespace.
Definition LossFunctions.cpp:33
Template to create a binary predicate.
Definition Testable.h:112
Represents an infinite plane in 3D, which is composed of a planar normal and its perpendicular distan...
Definition OrientedPlane3.h:39
A 3D pose (R,t) : (Rot3,Point3).
Definition Pose3.h:42
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual Vector3 evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
Key key() const
Definition NoiseModelFactorN.h:307
Nonlinear factor base class.
Definition NonlinearFactor.h:70
Factor to measure a planar landmark from a given pose.
Definition OrientedPlane3Factor.h:31
OrientedPlane3Factor(const Vector4 &z, const SharedGaussian &noiseModel, Key poseKey, Key landmarkKey)
Constructor with measured plane (a,b,c,d) coefficients.
Definition OrientedPlane3Factor.h:53
OrientedPlane3Factor()
Constructor.
Definition OrientedPlane3Factor.h:42
OrientedPlane3DirectionPrior(Key key, const Vector4 &z, const SharedGaussian &noiseModel)
Constructor with measured plane coefficients (a,b,c,d), noise model, landmark symbol.
Definition OrientedPlane3Factor.h:84
NoiseModelFactorN< OrientedPlane3 > Base
measured plane parameters
Definition OrientedPlane3Factor.h:71
OrientedPlane3DirectionPrior()
Constructor.
Definition OrientedPlane3Factor.h:80