MROB
factor1Pose1Plane4d.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  *
16  * factor1Pose1Plane4d.hpp
17  *
18  * Created on: Oct 10, 2020
19  * Author: Gonzalo Ferrer
20  * g.ferrer@skoltech.ru
21  * Mobile Robotics Lab, Skoltech
22  */
23 
24 #ifndef FACTOR1POSE1PLANE4D_HPP_
25 #define FACTOR1POSE1PLANE4D_HPP_
26 
27 
28 #include "mrob/matrix_base.hpp"
29 #include "mrob/factor.hpp"
30 
31 namespace mrob{
32 
41 {
42  public:
43  Factor1Pose1Plane4d(const Mat41 &observation, std::shared_ptr<Node> &nodePose,
44  std::shared_ptr<Node> &nodePlane, const Mat4 &obsInf,
45  Factor::robustFactorType robust_type = Factor::robustFactorType::QUADRATIC);
46  ~Factor1Pose1Plane4d() override = default;
47 
51  virtual void evaluate_residuals() override;
55  virtual void evaluate_jacobians() override;
56  virtual void evaluate_chi2() override;
57 
58  virtual void print() const;
59 
60  MatRefConst get_obs() const override {return obs_;};
61  VectRefConst get_residual() const override {return r_;};
62  MatRefConst get_information_matrix() const override {return W_;};
63  MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id = 0) const override {return J_;};
64 
65 
66  private:
67  Mat41 obs_, r_; //residuals
68  Mat<4,10> J_;//Jacobians dimensions obs x [plane(4) + pose(6)]
69  Mat4 W_;//inverse of observation covariance (information matrix)
70  bool reversedNodeOrder_;
71  // intermediate variables to keep
72  Mat41 plane_;
73  Mat4 Tinv_transp_;
74 
75  public:
76  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
77 
78 };
79 
80 }
81 
82 #endif /* FACTOR1POSE1PLANE4D_HPP_ */
Definition: factor1Pose1Plane4d.hpp:40
robustFactorType
Definition: factor.hpp:87
MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id=0) const override
Definition: factor1Pose1Plane4d.hpp:63
MatRefConst get_obs() const override
Definition: factor1Pose1Plane4d.hpp:60
VectRefConst get_residual() const override
Definition: factor1Pose1Plane4d.hpp:61
virtual void evaluate_jacobians() override
Definition: factor1Pose1Plane4d.cpp:87
virtual void evaluate_residuals() override
Definition: factor1Pose1Plane4d.cpp:53
virtual void print() const
Definition: factor1Pose1Plane4d.cpp:109
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
virtual void evaluate_chi2() override
Definition: factor1Pose1Plane4d.cpp:104