gtsam 4.2
gtsam
Loading...
Searching...
No Matches
LocalOrientedPlane3Factor.h
1/*
2 * @file LocalOrientedPlane3Factor.h
3 * @brief LocalOrientedPlane3 Factor class
4 * @author David Wisth
5 * @date February 12, 2021
6 */
7
8#pragma once
9
10#include <gtsam/geometry/OrientedPlane3.h>
12#include <gtsam_unstable/dllexport.h>
13
14#include <string>
15
16namespace gtsam {
17
37class GTSAM_UNSTABLE_EXPORT LocalOrientedPlane3Factor
38 : public NoiseModelFactorN<Pose3, Pose3, OrientedPlane3> {
39 protected:
40 OrientedPlane3 measured_p_;
42public:
45
46 ~LocalOrientedPlane3Factor() override {}
47
60 Key poseKey, Key anchorPoseKey, Key landmarkKey)
61 : Base(noiseModel, poseKey, anchorPoseKey, landmarkKey), measured_p_(z) {}
62
65 Key poseKey, Key anchorPoseKey, Key landmarkKey)
66 : Base(noiseModel, poseKey, anchorPoseKey, landmarkKey), measured_p_(z) {}
67
69 void print(const std::string& s = "LocalOrientedPlane3Factor",
70 const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
71
72 /***
73 * Vector of errors
74 * @brief Error = measured_plane_.error(a_plane.transform(inv(wTwa) * wTwi))
75 *
76 * This is the error of the measured and predicted plane in the current
77 * sensor frame, i. The plane is represented in the anchor pose, a.
78 *
79 * @param wTwi The pose of the sensor in world coordinates
80 * @param wTwa The pose of the anchor frame in world coordinates
81 * @param a_plane The estimated plane in anchor frame.
82 *
83 * Note: The optimized plane is represented in anchor frame, a, not the
84 * world frame.
85 */
86 Vector evaluateError(const Pose3& wTwi, const Pose3& wTwa,
87 const OrientedPlane3& a_plane,
88 boost::optional<Matrix&> H1 = boost::none,
89 boost::optional<Matrix&> H2 = boost::none,
90 boost::optional<Matrix&> H3 = boost::none) const override;
91};
92
93} // namespace gtsam
94
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:724
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:100
All noise models live in the noiseModel namespace.
Definition LossFunctions.cpp:27
Represents an infinite plane in 3D, which is composed of a planar normal and its perpendicular distan...
Definition OrientedPlane3.h:36
NoiseModelFactorN()
Definition NonlinearFactor.h:469
Factor to measure a planar landmark from a given pose, with a given local linearization point.
Definition LocalOrientedPlane3Factor.h:38
LocalOrientedPlane3Factor(const Vector4 &z, const SharedNoiseModel &noiseModel, Key poseKey, Key anchorPoseKey, Key landmarkKey)
Constructor with measured plane (a,b,c,d) coefficients.
Definition LocalOrientedPlane3Factor.h:59
LocalOrientedPlane3Factor()
Constructor.
Definition LocalOrientedPlane3Factor.h:44