Apollo  6.0
Open source self driving car software
loops_verify_agent.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 <utility>
20 #include <vector>
21 
22 #include "grpc++/grpc++.h"
23 
24 #include "modules/map/tools/map_datachecker/proto/collection_service.pb.h"
27 
28 namespace apollo {
29 namespace hdmap {
30 
32 
34  public:
36  std::shared_ptr<JsonConf> sp_conf,
37  std::shared_ptr<PoseCollectionAgent> sp_pose_collection_agent);
38  grpc::Status ProcessGrpcRequest(grpc::ServerContext *context,
39  LoopsVerifyRequest *request,
40  LoopsVerifyResponse *response);
41 
42  private:
43  void StartVerify(LoopsVerifyRequest *request, LoopsVerifyResponse *response);
44  void CheckVerify(LoopsVerifyRequest *request, LoopsVerifyResponse *response);
45  void StopVerify(LoopsVerifyRequest *request, LoopsVerifyResponse *response);
46  std::shared_ptr<std::vector<std::pair<double, double>>> get_verify_range(
47  LoopsVerifyRequest *request);
48  size_t GetLoopsToCheck(LoopsVerifyRequest *request);
49  int GetPosesToCheck(
50  std::shared_ptr<std::vector<std::pair<double, double>>> sp_range,
51  std::vector<FramePose> *poses);
52  int DoStartVerify(
53  std::shared_ptr<std::vector<std::pair<double, double>>> sp_range,
54  double loops_to_check);
55  double GetRangeIndex(
56  std::shared_ptr<std::vector<std::pair<double, double>>> sp_range,
57  std::vector<bool> *range_index,
58  std::shared_ptr<std::vector<FramePose>> sp_vec_poses);
59  void SetState(LoopsVerifyAgentState state);
61 
62  private:
63  std::shared_ptr<JsonConf> sp_conf_ = nullptr;
64  std::shared_ptr<PoseCollectionAgent> sp_pose_collection_agent_ = nullptr;
65  std::shared_ptr<LapsChecker> sp_laps_checker_ = nullptr;
66  LoopsVerifyAgentState state_;
67 };
68 
69 } // namespace hdmap
70 } // namespace apollo
LoopsVerifyAgentState
Definition: loops_verify_agent.h:31
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
State GetState()
Definition: loops_verify_agent.h:33
void SetState(const State &state)