Apollo 10.0
自动驾驶开放平台
apollo::routing::TopoNode类 参考

#include <topo_node.h>

apollo::routing::TopoNode 的协作图:

Public 成员函数

 TopoNode (const Node &node)
 
 TopoNode (const TopoNode *topo_node, const NodeSRange &range)
 
 ~TopoNode ()
 
const NodePbNode () const
 
double Length () const
 
double Cost () const
 
bool IsVirtual () const
 
const std::string & LaneId () const
 
const std::string & RoadId () const
 
const hdmap::CurveCentralCurve () const
 
const common::PointENUAnchorPoint () const
 
const std::vector< NodeSRange > & LeftOutRange () const
 
const std::vector< NodeSRange > & RightOutRange () const
 
const std::unordered_set< const TopoEdge * > & InFromAllEdge () const
 
const std::unordered_set< const TopoEdge * > & InFromLeftEdge () const
 
const std::unordered_set< const TopoEdge * > & InFromRightEdge () const
 
const std::unordered_set< const TopoEdge * > & InFromLeftOrRightEdge () const
 
const std::unordered_set< const TopoEdge * > & InFromPreEdge () const
 
const std::unordered_set< const TopoEdge * > & OutToAllEdge () const
 
const std::unordered_set< const TopoEdge * > & OutToLeftEdge () const
 
const std::unordered_set< const TopoEdge * > & OutToRightEdge () const
 
const std::unordered_set< const TopoEdge * > & OutToLeftOrRightEdge () const
 
const std::unordered_set< const TopoEdge * > & OutToSucEdge () const
 
const TopoEdgeGetInEdgeFrom (const TopoNode *from_node) const
 
const TopoEdgeGetOutEdgeTo (const TopoNode *to_node) const
 
const TopoNodeOriginNode () const
 
double StartS () const
 
double EndS () const
 
bool IsSubNode () const
 
bool IsInFromPreEdgeValid () const
 
bool IsOutToSucEdgeValid () const
 
bool IsOverlapEnough (const TopoNode *sub_node, const TopoEdge *edge_for_type) const
 
void AddInEdge (const TopoEdge *edge)
 
void AddOutEdge (const TopoEdge *edge)
 

静态 Public 成员函数

static bool IsOutRangeEnough (const std::vector< NodeSRange > &range_vec, double start_s, double end_s)
 

详细描述

在文件 topo_node.h32 行定义.

构造及析构函数说明

◆ TopoNode() [1/2]

apollo::routing::TopoNode::TopoNode ( const Node node)
explicit

在文件 topo_node.cc97 行定义.

98 : pb_node_(node), start_s_(0.0), end_s_(pb_node_.length()) {
99 ACHECK(pb_node_.length() > kLenghtEpsilon)
100 << "Node length is invalid in pb: " << pb_node_.DebugString();
101 Init();
102 origin_node_ = this;
103}
#define ACHECK(cond)
Definition log.h:80
optional double length

◆ TopoNode() [2/2]

apollo::routing::TopoNode::TopoNode ( const TopoNode topo_node,
const NodeSRange range 
)

在文件 topo_node.cc105 行定义.

106 : TopoNode(topo_node->PbNode()) {
107 origin_node_ = topo_node;
108 start_s_ = range.StartS();
109 end_s_ = range.EndS();
110 Init();
111}
const TopoNode * topo_node
TopoNode(const Node &node)
Definition topo_node.cc:97

◆ ~TopoNode()

apollo::routing::TopoNode::~TopoNode ( )

在文件 topo_node.cc113 行定义.

113{}

成员函数说明

◆ AddInEdge()

void apollo::routing::TopoNode::AddInEdge ( const TopoEdge edge)

在文件 topo_node.cc256 行定义.

256 {
257 if (edge->ToNode() != this) {
258 return;
259 }
260 if (in_edge_map_.count(edge->FromNode()) != 0) {
261 return;
262 }
263 switch (edge->Type()) {
264 case TET_LEFT:
265 in_from_right_edge_set_.insert(edge);
266 in_from_left_or_right_edge_set_.insert(edge);
267 break;
268 case TET_RIGHT:
269 in_from_left_edge_set_.insert(edge);
270 in_from_left_or_right_edge_set_.insert(edge);
271 break;
272 default:
273 in_from_pre_edge_set_.insert(edge);
274 break;
275 }
276 in_from_all_edge_set_.insert(edge);
277 in_edge_map_[edge->FromNode()] = edge;
278}

◆ AddOutEdge()

void apollo::routing::TopoNode::AddOutEdge ( const TopoEdge edge)

在文件 topo_node.cc280 行定义.

280 {
281 if (edge->FromNode() != this) {
282 return;
283 }
284 if (out_edge_map_.count(edge->ToNode()) != 0) {
285 return;
286 }
287 switch (edge->Type()) {
288 case TET_LEFT:
289 out_to_left_edge_set_.insert(edge);
290 out_to_left_or_right_edge_set_.insert(edge);
291 break;
292 case TET_RIGHT:
293 out_to_right_edge_set_.insert(edge);
294 out_to_left_or_right_edge_set_.insert(edge);
295 break;
296 default:
297 out_to_suc_edge_set_.insert(edge);
298 break;
299 }
300 out_to_all_edge_set_.insert(edge);
301 out_edge_map_[edge->ToNode()] = edge;
302}

◆ AnchorPoint()

const common::PointENU & apollo::routing::TopoNode::AnchorPoint ( ) const

在文件 topo_node.cc170 行定义.

170{ return anchor_point_; }

◆ CentralCurve()

const hdmap::Curve & apollo::routing::TopoNode::CentralCurve ( ) const

在文件 topo_node.cc166 行定义.

166 {
167 return pb_node_.central_curve();
168}
optional apollo::hdmap::Curve central_curve

◆ Cost()

double apollo::routing::TopoNode::Cost ( ) const

在文件 topo_node.cc158 行定义.

158{ return pb_node_.cost(); }
optional double cost

◆ EndS()

double apollo::routing::TopoNode::EndS ( ) const

在文件 topo_node.cc234 行定义.

234{ return end_s_; }

◆ GetInEdgeFrom()

const TopoEdge * apollo::routing::TopoNode::GetInEdgeFrom ( const TopoNode from_node) const

在文件 topo_node.cc222 行定义.

222 {
223 return FindPtrOrNull(in_edge_map_, from_node);
224}

◆ GetOutEdgeTo()

const TopoEdge * apollo::routing::TopoNode::GetOutEdgeTo ( const TopoNode to_node) const

在文件 topo_node.cc226 行定义.

226 {
227 return FindPtrOrNull(out_edge_map_, to_node);
228}

◆ InFromAllEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::InFromAllEdge ( ) const

在文件 topo_node.cc180 行定义.

180 {
181 return in_from_all_edge_set_;
182}

◆ InFromLeftEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::InFromLeftEdge ( ) const

在文件 topo_node.cc184 行定义.

184 {
185 return in_from_left_edge_set_;
186}

◆ InFromLeftOrRightEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::InFromLeftOrRightEdge ( ) const

在文件 topo_node.cc192 行定义.

193 {
194 return in_from_left_or_right_edge_set_;
195}

◆ InFromPreEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::InFromPreEdge ( ) const

在文件 topo_node.cc197 行定义.

197 {
198 return in_from_pre_edge_set_;
199}

◆ InFromRightEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::InFromRightEdge ( ) const

在文件 topo_node.cc188 行定义.

188 {
189 return in_from_right_edge_set_;
190}

◆ IsInFromPreEdgeValid()

bool apollo::routing::TopoNode::IsInFromPreEdgeValid ( ) const

在文件 topo_node.cc304 行定义.

304 {
305 return std::fabs(StartS() - OriginNode()->StartS()) < MIN_INTERNAL_FOR_NODE;
306}
const TopoNode * OriginNode() const
Definition topo_node.cc:230

◆ IsOutRangeEnough()

bool apollo::routing::TopoNode::IsOutRangeEnough ( const std::vector< NodeSRange > &  range_vec,
double  start_s,
double  end_s 
)
static

在文件 topo_node.cc67 行定义.

68 {
69 if (!NodeSRange::IsEnoughForChangeLane(start_s, end_s)) {
70 return false;
71 }
72 int start_index = BinarySearchForSLarger(range_vec, start_s);
73 int end_index = BinarySearchForSSmaller(range_vec, end_s);
74
75 int index_diff = end_index - start_index;
76 if (start_index < 0 || end_index < 0) {
77 return false;
78 }
79 if (index_diff > 1) {
80 return true;
81 }
82
83 double pre_s_s = std::max(start_s, range_vec[start_index].StartS());
84 double suc_e_s = std::min(end_s, range_vec[end_index].EndS());
85
86 if (index_diff == 1) {
87 double dlt = range_vec[start_index].EndS() - pre_s_s;
88 dlt += suc_e_s - range_vec[end_index].StartS();
90 }
91 if (index_diff == 0) {
92 return NodeSRange::IsEnoughForChangeLane(pre_s_s, suc_e_s);
93 }
94 return false;
95}
bool IsEnoughForChangeLane() const
Definition topo_range.cc:48
int BinarySearchForSSmaller(const std::vector< T > &sorted_vec, double value_s)
Definition range_utils.h:50
int BinarySearchForSLarger(const std::vector< T > &sorted_vec, double value_s)
Definition range_utils.h:25

◆ IsOutToSucEdgeValid()

bool apollo::routing::TopoNode::IsOutToSucEdgeValid ( ) const

在文件 topo_node.cc308 行定义.

308 {
309 return std::fabs(EndS() - OriginNode()->EndS()) < MIN_INTERNAL_FOR_NODE;
310}

◆ IsOverlapEnough()

bool apollo::routing::TopoNode::IsOverlapEnough ( const TopoNode sub_node,
const TopoEdge edge_for_type 
) const

在文件 topo_node.cc238 行定义.

239 {
240 if (edge_for_type->Type() == TET_LEFT) {
241 return (is_left_range_enough_ &&
242 IsOutRangeEnough(left_out_sorted_range_, sub_node->StartS(),
243 sub_node->EndS()));
244 }
245 if (edge_for_type->Type() == TET_RIGHT) {
246 return (is_right_range_enough_ &&
247 IsOutRangeEnough(right_out_sorted_range_, sub_node->StartS(),
248 sub_node->EndS()));
249 }
250 if (edge_for_type->Type() == TET_FORWARD) {
251 return IsOutToSucEdgeValid() && sub_node->IsInFromPreEdgeValid();
252 }
253 return true;
254}
bool IsOutToSucEdgeValid() const
Definition topo_node.cc:308
static bool IsOutRangeEnough(const std::vector< NodeSRange > &range_vec, double start_s, double end_s)
Definition topo_node.cc:67

◆ IsSubNode()

bool apollo::routing::TopoNode::IsSubNode ( ) const

在文件 topo_node.cc236 行定义.

236{ return OriginNode() != this; }

◆ IsVirtual()

bool apollo::routing::TopoNode::IsVirtual ( ) const

在文件 topo_node.cc160 行定义.

160{ return pb_node_.is_virtual(); }
optional bool is_virtual

◆ LaneId()

const std::string & apollo::routing::TopoNode::LaneId ( ) const

在文件 topo_node.cc162 行定义.

162{ return pb_node_.lane_id(); }
optional string lane_id

◆ LeftOutRange()

const std::vector< NodeSRange > & apollo::routing::TopoNode::LeftOutRange ( ) const

在文件 topo_node.cc172 行定义.

172 {
173 return left_out_sorted_range_;
174}

◆ Length()

double apollo::routing::TopoNode::Length ( ) const

在文件 topo_node.cc156 行定义.

156{ return pb_node_.length(); }

◆ OriginNode()

const TopoNode * apollo::routing::TopoNode::OriginNode ( ) const

在文件 topo_node.cc230 行定义.

230{ return origin_node_; }

◆ OutToAllEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::OutToAllEdge ( ) const

在文件 topo_node.cc201 行定义.

201 {
202 return out_to_all_edge_set_;
203}

◆ OutToLeftEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::OutToLeftEdge ( ) const

在文件 topo_node.cc205 行定义.

205 {
206 return out_to_left_edge_set_;
207}

◆ OutToLeftOrRightEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::OutToLeftOrRightEdge ( ) const

在文件 topo_node.cc213 行定义.

214 {
215 return out_to_left_or_right_edge_set_;
216}

◆ OutToRightEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::OutToRightEdge ( ) const

在文件 topo_node.cc209 行定义.

209 {
210 return out_to_right_edge_set_;
211}

◆ OutToSucEdge()

const std::unordered_set< const TopoEdge * > & apollo::routing::TopoNode::OutToSucEdge ( ) const

在文件 topo_node.cc218 行定义.

218 {
219 return out_to_suc_edge_set_;
220}

◆ PbNode()

const Node & apollo::routing::TopoNode::PbNode ( ) const

在文件 topo_node.cc154 行定义.

154{ return pb_node_; }

◆ RightOutRange()

const std::vector< NodeSRange > & apollo::routing::TopoNode::RightOutRange ( ) const

在文件 topo_node.cc176 行定义.

176 {
177 return right_out_sorted_range_;
178}

◆ RoadId()

const std::string & apollo::routing::TopoNode::RoadId ( ) const

在文件 topo_node.cc164 行定义.

164{ return pb_node_.road_id(); }
optional string road_id

◆ StartS()

double apollo::routing::TopoNode::StartS ( ) const

在文件 topo_node.cc232 行定义.

232{ return start_s_; }

该类的文档由以下文件生成: