MROB
factor1Pose2d.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  * Created on: Jan 14, 2019
17  * Author: Konstantin Pakulev
18  * konstantin.pakulev@skoltech.ru
19  * Gonzalo Ferrer
20  * g.ferrer@skoltech.ru
21  * Mobile Robotics Lab, Skoltech
22  */
23 
24 #ifndef MROB_FACTOR1POSE2D_H
25 #define MROB_FACTOR1POSE2D_H
26 
27 #include "mrob/matrix_base.hpp"
28 #include "mrob/factor.hpp"
29 
30 using namespace mrob;
31 
32 
44 namespace mrob{
45  class Factor1Pose2d : public Factor
46  {
47  public:
48  Factor1Pose2d(const Mat31 &observation, std::shared_ptr<Node> &n1,
49  const Mat3 &obsInf, Factor::robustFactorType robust_type = Factor::robustFactorType::QUADRATIC);
50  ~Factor1Pose2d() override = default;
51 
52  void evaluate_residuals() override;
53  void evaluate_jacobians() override;
54  void evaluate_chi2() override;
55 
56  void print() const;
57 
58  MatRefConst get_obs() const {return obs_;};
59  VectRefConst get_residual() const {return r_;};
60  MatRefConst get_information_matrix() const {return W_;};
61  MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id = 0) const {return J_;};
62 
63  protected:
64  Mat31 obs_, r_; //and residuals
65  Mat3 W_;//inverse of observation covariance (information matrix)
66  Mat3 J_;//Jacobian
67  };
68 }
69 
70 #endif //MROB_FACTOR1POSE2D_H
robustFactorType
Definition: factor.hpp:87
Definition: factor1Pose2d.hpp:45
VectRefConst get_residual() const
Definition: factor1Pose2d.hpp:59
MatRefConst get_jacobian([[maybe_unused]] mrob::factor_id_t id=0) const
Definition: factor1Pose2d.hpp:61
void evaluate_jacobians() override
Definition: factor1Pose2d.cpp:37
void evaluate_chi2() override
Definition: factor1Pose2d.cpp:49
void evaluate_residuals() override
Definition: factor1Pose2d.cpp:43
void print() const
Definition: factor1Pose2d.cpp:54
MatRefConst get_obs() const
Definition: factor1Pose2d.hpp:58
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