Apollo  6.0
Open source self driving car software
static_align.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2019 The Apollo Authors. All Rights Reserved.
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 #pragma once
17 
18 #include <memory>
19 #include <vector>
20 
23 
24 namespace apollo {
25 namespace hdmap {
26 
28  RANSAC,
30 };
31 
32 typedef struct Point3d {
33  Point3d() : x(0.0), y(0.0), z(0.0) {}
34  double x, y, z;
35 } Point3d;
36 
37 typedef struct Centroid3D {
38  Centroid3D() : count(0), start_time(0.0), end_time(0.0) {}
40  int count;
41  double start_time, end_time;
42 } Centroid3D;
43 
44 class StaticAlign : public Alignment {
45  public:
46  explicit StaticAlign(std::shared_ptr<JsonConf> sp_conf);
47  ErrorCode Process(const std::vector<FramePose>& poses);
48 
49  private:
50  void Reset();
51  double GetStaticAlignProgress(const std::vector<FramePose>& poses);
52  double StaticAlignRansac(const std::vector<FramePose>& poses);
53  double StaticAlignDynamicCentroid(const std::vector<FramePose>& poses);
54  double GetCentroidTimeDuring();
55  void UpdateDynamicCentroid(const FramePose& pose);
56  bool IsStaticPose(const FramePose& pose);
57  void UpdateGoodPoseInfo(const FramePose& pose);
58 
59  private:
60  StaticAlignDetectMethod static_align_detect_method_;
61  Centroid3D dynamic_centroid_;
62 };
63 
64 } // namespace hdmap
65 } // namespace apollo
Centroid3D()
Definition: static_align.h:38
Definition: static_align.h:37
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Point3d center
Definition: static_align.h:39
struct apollo::hdmap::Centroid3D Centroid3D
Definition: static_align.h:32
Definition: client_alignment.h:142
double z
Definition: static_align.h:34
Point3d()
Definition: static_align.h:33
Definition: common.h:42
Definition: client_alignment.h:35
StaticAlignDetectMethod
Definition: static_align.h:27
struct apollo::hdmap::Point3d Point3d
int count
Definition: static_align.h:40
double start_time
Definition: static_align.h:41