Apollo  6.0
Open source self driving car software
navigator.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2017 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 
17 #pragma once
18 
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
25 
26 namespace apollo {
27 namespace routing {
28 
29 class Navigator {
30  public:
31  explicit Navigator(const std::string& topo_file_path);
32  ~Navigator();
33 
34  bool IsReady() const;
35 
36  bool SearchRoute(const RoutingRequest& request,
37  RoutingResponse* const response);
38 
39  private:
40  bool Init(const RoutingRequest& request, const TopoGraph* graph,
41  std::vector<const TopoNode*>* const way_nodes,
42  std::vector<double>* const way_s);
43 
44  void Clear();
45 
46  bool SearchRouteByStrategy(
47  const TopoGraph* graph, const std::vector<const TopoNode*>& way_nodes,
48  const std::vector<double>& way_s,
49  std::vector<NodeWithRange>* const result_nodes) const;
50 
51  bool MergeRoute(const std::vector<NodeWithRange>& node_vec,
52  std::vector<NodeWithRange>* const result_node_vec) const;
53 
54  private:
55  bool is_ready_ = false;
56  std::unique_ptr<TopoGraph> graph_;
57 
58  TopoRangeManager topo_range_manager_;
59 
60  std::unique_ptr<BlackListRangeGenerator> black_list_generator_;
61  std::unique_ptr<ResultGenerator> result_generator_;
62 };
63 
64 } // namespace routing
65 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: topo_range_manager.h:27
Navigator(const std::string &topo_file_path)
bool SearchRoute(const RoutingRequest &request, RoutingResponse *const response)
Definition: topo_graph.h:31
Definition: navigator.h:29