Apollo 10.0
自动驾驶开放平台
result_generator.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 <string>
20#include <utility>
21#include <vector>
22
23#include "modules/common_msgs/routing_msgs/routing.pb.h"
24
27
28namespace apollo {
29namespace routing {
30
32 public:
33 ResultGenerator() = default;
34 ~ResultGenerator() = default;
35
36 bool GeneratePassageRegion(const std::string& map_version,
37 const routing::RoutingRequest& request,
38 const std::vector<NodeWithRange>& nodes,
39 const TopoRangeManager& range_manager,
40 routing::RoutingResponse* const result);
41
42 private:
43 struct PassageInfo {
44 std::vector<NodeWithRange> nodes;
45 ChangeLaneType change_lane_type;
46 PassageInfo() = default;
47 PassageInfo(const std::vector<NodeWithRange>& _nodes,
48 ChangeLaneType _change_lane_type)
49 : nodes(_nodes), change_lane_type(_change_lane_type) {}
50 };
51
52 bool GeneratePassageRegion(const std::vector<NodeWithRange>& nodes,
53 const TopoRangeManager& range_manager,
54 routing::RoutingResponse* const result);
55
56 void CreateRoadSegments(const std::vector<PassageInfo>& passages,
58
59 void AddRoadSegment(const std::vector<PassageInfo>& passages,
60 const std::pair<std::size_t, std::size_t>& start_index,
61 const std::pair<std::size_t, std::size_t>& end_index,
63 void ExtendPassages(const TopoRangeManager& range_manager,
64 std::vector<PassageInfo>* const passages);
65 bool ExtractBasicPassages(const std::vector<NodeWithRange>& nodes,
66 std::vector<PassageInfo>* const passsages);
67 void ExtendBackward(const TopoRangeManager& range_manager,
68 const PassageInfo& prev_passage,
69 PassageInfo* const curr_passage);
70 void ExtendForward(const TopoRangeManager& range_manager,
71 const PassageInfo& next_passage,
72 PassageInfo* const curr_passage);
73 bool IsReachableFromWithChangeLane(const TopoNode* from_node,
74 const PassageInfo& to_nodes,
75 NodeWithRange* reachable_node);
76 bool IsReachableToWithChangeLane(const TopoNode* from_node,
77 const PassageInfo& to_nodes,
78 NodeWithRange* reachable_node);
79};
80
81} // namespace routing
82} // namespace apollo
bool GeneratePassageRegion(const std::string &map_version, const routing::RoutingRequest &request, const std::vector< NodeWithRange > &nodes, const TopoRangeManager &range_manager, routing::RoutingResponse *const result)
class register implement
Definition arena_queue.h:37