mapping_2d/scan_matching/rotation_delta_cost_functor.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CARTOGRAPHER_MAPPING_2D_SCAN_MATCHING_ROTATION_DELTA_COST_FUNCTOR_H_
18 #define CARTOGRAPHER_MAPPING_2D_SCAN_MATCHING_ROTATION_DELTA_COST_FUNCTOR_H_
19 
20 #include "Eigen/Core"
22 
23 namespace cartographer {
24 namespace mapping_2d {
25 namespace scan_matching {
26 
27 // Computes the cost of rotating the initial pose estimate. Cost increases with
28 // the solution's distance from the initial estimate.
30  public:
31  // Constructs a new RotationDeltaCostFunctor for the given 'angle'.
32  explicit RotationDeltaCostFunctor(const double scaling_factor,
33  const double angle)
34  : scaling_factor_(scaling_factor), angle_(angle) {}
35 
38 
39  template <typename T>
40  bool operator()(const T* const pose, T* residual) const {
41  residual[0] = scaling_factor_ * (pose[2] - angle_);
42  return true;
43  }
44 
45  private:
46  const double scaling_factor_;
47  const double angle_;
48 };
49 
50 } // namespace scan_matching
51 } // namespace mapping_2d
52 } // namespace cartographer
53 
54 #endif // CARTOGRAPHER_MAPPING_2D_SCAN_MATCHING_ROTATION_DELTA_COST_FUNCTOR_H_
RotationDeltaCostFunctor & operator=(const RotationDeltaCostFunctor &)=delete
transform::Rigid3d pose
float angle


cartographer
Author(s):
autogenerated on Mon Jun 10 2019 12:51:39