MROB
factor1Pose3d.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  * factor1Pose3d.hpp
17  *
18  * Created on: Mar 5, 2018
19  * Author: Gonzalo Ferrer
20  * g.ferrer@skoltech.ru
21  * Mobile Robotics Lab, Skoltech
22  */
23 
24 #ifndef FACTOR1POSE3D_HPP_
25 #define FACTOR1POSE3D_HPP_
26 
27 
28 #include "mrob/matrix_base.hpp"
29 #include "mrob/SE3.hpp" //requires including and linking SE3 library
30 #include "mrob/factor.hpp"
31 
32 namespace mrob{
33 
44 class Factor1Pose3d : public Factor
45 {
46  public:
47  Factor1Pose3d(const Mat4 &observation, std::shared_ptr<Node> &n1, const Mat6 &obsInf,
48  Factor::robustFactorType robust_type = Factor::robustFactorType::QUADRATIC);
49  Factor1Pose3d(const SE3 &observation, std::shared_ptr<Node> &n1, const Mat6 &obsInf,
50  Factor::robustFactorType robust_type = Factor::robustFactorType::QUADRATIC);
51  ~Factor1Pose3d() override = default;
55  void evaluate_residuals() override;
56  void evaluate_jacobians() override;
57  void evaluate_chi2() override;
58 
59  void print() const;
60 
61  MatRefConst get_obs() const {return Tobs_.T();};
62  VectRefConst get_residual() const {return r_;};
63  MatRefConst get_information_matrix() const {return W_;};
64  MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id = 0) const {return J_;};
65 
66 
67  protected:
68  Mat61 r_; //and residuals
69  SE3 Tobs_, Tr_;//Transformation for the observation and the residual
70  Mat6 W_;//inverse of observation covariance (information matrix)
71  Mat6 J_;//Jacobian
72 
73 
74 };
75 
76 
77 }
78 
79 
80 
81 #endif /* FACTOR1POSE3D_HPP_ */
const Eigen::Ref< const Mat4 > T() const
Definition: SE3.cpp:237
robustFactorType
Definition: factor.hpp:87
Definition: SE3.hpp:50
void evaluate_residuals() override
Definition: factor1Pose3d.cpp:48
void evaluate_chi2() override
Definition: factor1Pose3d.cpp:66
VectRefConst get_residual() const
Definition: factor1Pose3d.hpp:62
Definition: factor1Pose3d.hpp:44
MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id=0) const
Definition: factor1Pose3d.hpp:64
void evaluate_jacobians() override
Definition: factor1Pose3d.cpp:58
MatRefConst get_obs() const
Definition: factor1Pose3d.hpp:61
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
void print() const
Definition: factor1Pose3d.cpp:71
Definition: factor.hpp:81