MROB
factor1PosePoint2Plane.hpp
1 /* Copyright (c) 2022, Gonzalo Ferrer
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15  * factor1PosePoint2Plane.hpp
16  *
17  * Created on: Dec 24, 2020
18  * Author: Gonzalo Ferrer
19  * g.ferrer@skoltech.ru
20  * Mobile Robotics Lab.
21  */
22 
23 #ifndef FACTOR1POSEPOINT2PLANE_HPP_
24 #define FACTOR1POSEPOINT2PLANE_HPP_
25 
26 #include "mrob/matrix_base.hpp"
27 #include "mrob/SE3.hpp" //requires including and linking SE3 library
28 #include "mrob/factor.hpp"
29 
30 namespace mrob{
31 
55 {
56  public:
57  Factor1PosePoint2Plane(const Mat31 &z_point_x, const Mat31 &z_point_y, const Mat31 &z_normal_y,
58  std::shared_ptr<Node> &node, const Mat1 &obsInf,
59  Factor::robustFactorType robust_type = Factor::robustFactorType::QUADRATIC);
60  ~Factor1PosePoint2Plane() override = default;
67  virtual void evaluate_residuals() override;
72  virtual void evaluate_jacobians() override;
73  virtual void evaluate_chi2() override;
74 
75  virtual void print() const;
76 
77  MatRefConst get_obs() const override {return r_;};
78  VectRefConst get_residual() const override {return r_;};
79  MatRefConst get_information_matrix() const override {return W_;};
80  MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id = 0) const override {return J_;};
81 
82  protected:
83  Mat31 z_point_x_, z_point_y_, Tx_;
84  Mat31 z_normal_y_;
85  // the residual of the point projected to the plane:
86  Mat1 r_;//residual, for convention, we will keep an eigen object for the scalar
87  Mat1 W_;
88  Mat<1,6> J_;
89 };
90 
91 }
92 
93 #endif /* FACTOR1POSEPoint2Plane_HPP_ */
robustFactorType
Definition: factor.hpp:87
virtual void evaluate_residuals() override
Definition: factor1PosePoint2Plane.cpp:38
virtual void evaluate_chi2() override
Definition: factor1PosePoint2Plane.cpp:55
virtual void evaluate_jacobians() override
Definition: factor1PosePoint2Plane.cpp:47
virtual void print() const
Definition: factor1PosePoint2Plane.cpp:60
Definition: factor1PosePoint2Plane.hpp:54
Special Euclidean (group) in 3d Is the group representing rotations and translations, that is, rigid body transformations. SE3 = {T = [R t] | R SO3 , t Re^3 } [0 1] Associated to the groups of RBT, there is the Lie algebra se3 representing the same transformation in the tangent space around the identity. Particularly, xi =[w , v] Re^6, where w Re^3 represents the rotation and v the translation. We will preserve this order in this class.
Definition: matrix_base.hpp:36
Definition: factor.hpp:81
VectRefConst get_residual() const override
Definition: factor1PosePoint2Plane.hpp:78
MatRefConst get_obs() const override
Definition: factor1PosePoint2Plane.hpp:77
MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id=0) const override
Definition: factor1PosePoint2Plane.hpp:80