Apollo 10.0
自动驾驶开放平台
navigator.h
浏览该文件的文档.
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
26namespace apollo {
27namespace routing {
28
29class Navigator {
30 public:
31 explicit Navigator(const std::string& topo_file_path);
32 ~Navigator();
33
34 bool IsReady() const;
35
36 bool SearchRoute(const routing::RoutingRequest& request,
37 routing::RoutingResponse* const response);
38
39 private:
40 bool Init(const routing::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
bool SearchRoute(const routing::RoutingRequest &request, routing::RoutingResponse *const response)
Definition navigator.cc:206
class register implement
Definition arena_queue.h:37