MROB
factor1PosePoint2Point.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  * factor1PosePoint2Point.hpp
16  *
17  * Created on: Dec 29, 2020
18  * Author: Gonzalo Ferrer
19  * g.ferrer@skoltech.ru
20  * Mobile Robotics Lab.
21  */
22 
23 #ifndef FACTOR1POSEPOINT2POINT_HPP_
24 #define FACTOR1POSEPOINT2POINT_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 
53 {
54  public:
55  Factor1PosePoint2Point(const Mat31 &z_point_x, const Mat31 &z_point_y, std::shared_ptr<Node> &node,
56  const Mat3 &obsInf, Factor::robustFactorType robust_type = Factor::robustFactorType::QUADRATIC);
57  ~Factor1PosePoint2Point() override = default;
61  virtual void evaluate_residuals() override;
66  virtual void evaluate_jacobians() override;
67  virtual void evaluate_chi2() override;
68 
69  virtual void print() const;
70 
71  MatRefConst get_obs() const override {return r_;};
72  VectRefConst get_residual() const override {return r_;};
73  MatRefConst get_information_matrix() const override{return W_;};
74  MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id = 0) const override {return J_;};
75 
76  protected:
77  Mat31 z_point_x_, z_point_y_, Tx_;
78  Mat31 r_;
79  Mat3 W_;
80  Mat<3,6> J_;
81 };
82 
83 }
84 
85 
86 
87 #endif /* FACTOR1POSEPOINT2POINT_HPP_ */
robustFactorType
Definition: factor.hpp:87
VectRefConst get_residual() const override
Definition: factor1PosePoint2Point.hpp:72
virtual void evaluate_jacobians() override
Definition: factor1PosePoint2Point.cpp:47
Definition: factor1PosePoint2Point.hpp:52
virtual void evaluate_residuals() override
Definition: factor1PosePoint2Point.cpp:38
MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id=0) const override
Definition: factor1PosePoint2Point.hpp:74
MatRefConst get_obs() const override
Definition: factor1PosePoint2Point.hpp:71
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
virtual void print() const
Definition: factor1PosePoint2Point.cpp:58
Definition: factor.hpp:81
virtual void evaluate_chi2() override
Definition: factor1PosePoint2Point.cpp:53