MROB
EigenFactorPlaneCoordinatesAlign.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  * EigenFactorPlaneCoordinatesAlign.hpp
17  *
18  * Created on: Oct 31 2022
19  * Author: Gonzalo Ferrer
20  * g.ferrer@skoltech.ru
21  * Mobile Robotics Lab.
22  */
23 
24 // XXX this duplicate should disappear
25 #ifndef EIGENFACTORPLANECOORDINATEALIGN_HPP_
26 #define EIGENFACTORPLANECOORDINATEALIGN_HPP_
27 
28 
29 #include "mrob/factor.hpp"
30 #include "mrob/factors/EigenFactorPlaneCenter.hpp"
31 #include <unordered_map>
32 #include <deque>
33 #include <Eigen/StdVector>
34 
35 
36 namespace mrob{
37 
45 public:
50  EigenFactorPlaneCoordinatesAlign(Factor::robustFactorType robust_type = Factor::robustFactorType::QUADRATIC);
51  ~EigenFactorPlaneCoordinatesAlign() override = default;
56  void evaluate_residuals() override;
61  void evaluate_jacobians() override;
65  void evaluate_chi2() override;
66 
67 
68 protected:
69  Mat31 get_estimate_normal() const;
70 
71  Mat31 get_estimate_mean() const;
72 
73  void estimate_planes_at_poses();
74 
75  // These are the vectors of the eigenV for each pose of the plane, to be later used
76  std::deque<matData_t> lambda_1_,lambda_2_;//eigen values where l1 > l2> l3, to follow their notation
77  std::deque<matData_t> r1_, r2_, r3_, n_points_;//residual vectors plus point/plane at k pose
78  std::deque<Mat31, Eigen::aligned_allocator<Mat31>> v1_, v2_;// eigen vectors, same ordering
79 
80 
81 };
82 
83 }
84 #endif /* EigenFactorPlaneCenter_HPP_ */
robustFactorType
Definition: factor.hpp:87
void evaluate_chi2() override
Definition: EigenFactorPlaneCoordinatesAlign.cpp:122
Definition: EigenFactorPlaneCenter.hpp:57
void evaluate_jacobians() override
Definition: EigenFactorPlaneCoordinatesAlign.cpp:70
Definition: EigenFactorPlaneCoordinatesAlign.hpp:44
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 evaluate_residuals() override
Definition: EigenFactorPlaneCoordinatesAlign.cpp:38
EigenFactorPlaneCoordinatesAlign(Factor::robustFactorType robust_type=Factor::robustFactorType::QUADRATIC)
Definition: EigenFactorPlaneCoordinatesAlign.cpp:33