Apollo 10.0
自动驾驶开放平台
laps_checker.h
浏览该文件的文档.
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 <map>
19#include <memory>
20#include <utility>
21#include <vector>
22
23#include "modules/map/tools/map_datachecker/proto/collection_error_code.pb.h"
25
26namespace apollo {
27namespace hdmap {
28
29struct GridMeta {
30 double alpha;
31 std::vector<int> idxs;
32};
33typedef std::vector<GridMeta> Grid;
34
36 public:
37 LapsChecker(const std::vector<FramePose>& poses, int laps_to_check,
38 std::shared_ptr<JsonConf> sp_conf);
40 double GetProgress() const;
41 double GetConfidence();
42 size_t GetLap() const;
44
45 private:
46 void DoCheck();
47 int SetupGridsMap();
48 int CheckLaps();
49 int CheckParams();
50 int GetMinMax();
51 int DoSetupGridsMap();
52 double CalcAlpha(int pose_index);
53 int PutPoseToGrid(int pose_index, int grid_y, int grid_x);
54 int PutPoseToNeighborGrid(int pose_index);
55 int GetPassedGrid(int pose_index, std::vector<int>* sp_grid_x,
56 std::vector<int>* sp_grid_y);
57 double Slope(double x1, double y1, double x2, double y2);
58 int GatherTimestamps(std::vector<double>* sp_stamps, double alpha,
59 int center_x, int center_y);
60 inline int SetProgress(double p);
61
62 public:
63 const std::vector<FramePose>& poses_;
65 std::vector<std::vector<Grid>> grids_map_;
67
68 private:
69 std::vector<double> confidence_;
70 double progress_;
71 size_t laps_to_check_;
72 size_t possible_max_laps_;
73 size_t lap_;
74 std::shared_ptr<JsonConf> sp_conf_;
75 ErrorCode return_state_;
76};
77
78} // namespace hdmap
79} // namespace apollo
std::vector< std::vector< Grid > > grids_map_
const std::vector< FramePose > & poses_
std::vector< GridMeta > Grid
class register implement
Definition arena_queue.h:37
std::vector< int > idxs