Apollo 11.0
自动驾驶开放平台
road_graph.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 <list>
20#include <memory>
21#include <string>
22#include <vector>
23
26#include "modules/common_msgs/prediction_msgs/lane_graph.pb.h"
27
28namespace apollo {
29namespace prediction {
30
31class RoadGraph {
32 public:
40 RoadGraph(const double start_s, const double length,
41 const bool consider_divide,
42 std::shared_ptr<const hdmap::LaneInfo> lane_info_ptr);
43
49 common::Status BuildLaneGraph(LaneGraph* const lane_graph);
50
52
60 bool IsOnLaneGraph(std::shared_ptr<const hdmap::LaneInfo> lane_info_ptr,
61 const LaneGraph& lane_graph);
62
63 private:
67 LaneGraph CombineLaneGraphs(const LaneGraph& lane_graph_predecessor,
68 const LaneGraph& lane_graph_successor);
69
84 void ConstructLaneSequence(
85 const bool search_forward_direction, const double accumulated_s,
86 const double curr_lane_seg_s,
87 std::shared_ptr<const hdmap::LaneInfo> lane_info_ptr,
88 const int graph_search_horizon, const bool consider_lane_split,
89 std::list<LaneSegment>* const lane_segments,
90 LaneGraph* const lane_graph_ptr) const;
91
94 void ConstructLaneSequence(
95 const double accumulated_s, const double curr_lane_seg_s,
96 std::shared_ptr<const hdmap::LaneInfo> lane_info_ptr,
97 const int graph_search_horizon, const bool consider_lane_split,
98 std::list<LaneSegment>* const lane_segments,
99 LaneGraph* const lane_graph_ptr) const;
100
101 private:
102 // The s of the obstacle on its own lane_segment.
103 double start_s_ = 0;
104
105 // The total length to search for lane_graph.
106 double length_ = -1.0;
107
108 // If we consider all successor lanes after dividing
109 bool consider_divide_ = false;
110
111 // The lane_info of the lane_segment where the obstacle is on.
112 std::shared_ptr<const hdmap::LaneInfo> lane_info_ptr_ = nullptr;
113};
114
115} // namespace prediction
116} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
bool IsOnLaneGraph(std::shared_ptr< const hdmap::LaneInfo > lane_info_ptr, const LaneGraph &lane_graph)
Check if a lane with an s is on the lane graph
common::Status BuildLaneGraph(LaneGraph *const lane_graph)
Build the lane graph.
Definition road_graph.cc:94
common::Status BuildLaneGraphBidirection(LaneGraph *const lane_graph_ptr)
class register implement
Definition arena_queue.h:37