Apollo 11.0
自动驾驶开放平台
apollo::planning::Node2d类 参考

#include <grid_search.h>

apollo::planning::Node2d 的协作图:

Public 成员函数

 Node2d (const double x, const double y, const double xy_resolution, const std::vector< double > &XYbounds)
 
 Node2d (const int grid_x, const int grid_y, const std::vector< double > &XYbounds)
 
void SetPathCost (const double path_cost)
 
void SetHeuristic (const double heuristic)
 
void SetCost (const double cost)
 
void SetDistanceToObstacle (const double dist)
 
void SetPreNode (std::shared_ptr< Node2d > pre_node)
 
double GetGridX () const
 
double GetGridY () const
 
double GetPathCost () const
 
double GetHeuCost () const
 
double GetCost () const
 
double GetDistanceToObstacle () const
 
const std::string & GetIndex () const
 
std::shared_ptr< Node2d > GetPreNode () const
 
bool operator== (const Node2d &right) const
 

静态 Public 成员函数

static std::string CalcIndex (const double x, const double y, const double xy_resolution, const std::vector< double > &XYbounds)
 

详细描述

在文件 grid_search.h 第 42 行定义.

构造及析构函数说明

◆ Node2d() [1/2]

apollo::planning::Node2d::Node2d ( const double  x,
const double  y,
const double  xy_resolution,
const std::vector< double > &  XYbounds 
)
inline

在文件 grid_search.h 第 44 行定义.

44 {
45 // XYbounds with xmin, xmax, ymin, ymax
46 grid_x_ = static_cast<int>((x - XYbounds[0]) / xy_resolution);
47 grid_y_ = static_cast<int>((y - XYbounds[2]) / xy_resolution);
48 index_ = ComputeStringIndex(grid_x_, grid_y_);
49 }

◆ Node2d() [2/2]

apollo::planning::Node2d::Node2d ( const int  grid_x,
const int  grid_y,
const std::vector< double > &  XYbounds 
)
inline

在文件 grid_search.h 第 50 行定义.

50 {
51 grid_x_ = grid_x;
52 grid_y_ = grid_y;
53 index_ = ComputeStringIndex(grid_x_, grid_y_);
54 }

成员函数说明

◆ CalcIndex()

static std::string apollo::planning::Node2d::CalcIndex ( const double  x,
const double  y,
const double  xy_resolution,
const std::vector< double > &  XYbounds 
)
inlinestatic

在文件 grid_search.h 第 96 行定义.

100 {
101 // XYbounds with xmin, xmax, ymin, ymax
102 int grid_x = static_cast<int>((x - XYbounds[0]) / xy_resolution);
103 int grid_y = static_cast<int>((y - XYbounds[2]) / xy_resolution);
104 return ComputeStringIndex(grid_x, grid_y);
105 }

◆ GetCost()

double apollo::planning::Node2d::GetCost ( ) const
inline

在文件 grid_search.h 第 84 行定义.

84 {
85 return cost_;
86 }

◆ GetDistanceToObstacle()

double apollo::planning::Node2d::GetDistanceToObstacle ( ) const
inline

在文件 grid_search.h 第 87 行定义.

87 {
88 return distance_to_obstacle_;
89 }

◆ GetGridX()

double apollo::planning::Node2d::GetGridX ( ) const
inline

在文件 grid_search.h 第 72 行定义.

72 {
73 return grid_x_;
74 }

◆ GetGridY()

double apollo::planning::Node2d::GetGridY ( ) const
inline

在文件 grid_search.h 第 75 行定义.

75 {
76 return grid_y_;
77 }

◆ GetHeuCost()

double apollo::planning::Node2d::GetHeuCost ( ) const
inline

在文件 grid_search.h 第 81 行定义.

81 {
82 return heuristic_;
83 }

◆ GetIndex()

const std::string & apollo::planning::Node2d::GetIndex ( ) const
inline

在文件 grid_search.h 第 90 行定义.

90 {
91 return index_;
92 }

◆ GetPathCost()

double apollo::planning::Node2d::GetPathCost ( ) const
inline

在文件 grid_search.h 第 78 行定义.

78 {
79 return path_cost_;
80 }

◆ GetPreNode()

std::shared_ptr< Node2d > apollo::planning::Node2d::GetPreNode ( ) const
inline

在文件 grid_search.h 第 93 行定义.

93 {
94 return pre_node_;
95 }

◆ operator==()

bool apollo::planning::Node2d::operator== ( const Node2d &  right) const
inline

在文件 grid_search.h 第 106 行定义.

106 {
107 return right.GetIndex() == index_;
108 }

◆ SetCost()

void apollo::planning::Node2d::SetCost ( const double  cost)
inline

在文件 grid_search.h 第 63 行定义.

63 {
64 cost_ = cost;
65 }

◆ SetDistanceToObstacle()

void apollo::planning::Node2d::SetDistanceToObstacle ( const double  dist)
inline

在文件 grid_search.h 第 66 行定义.

66 {
67 distance_to_obstacle_ = dist;
68 }

◆ SetHeuristic()

void apollo::planning::Node2d::SetHeuristic ( const double  heuristic)
inline

在文件 grid_search.h 第 59 行定义.

59 {
60 heuristic_ = heuristic;
61 cost_ = path_cost_ + heuristic_;
62 }

◆ SetPathCost()

void apollo::planning::Node2d::SetPathCost ( const double  path_cost)
inline

在文件 grid_search.h 第 55 行定义.

55 {
56 path_cost_ = path_cost;
57 cost_ = path_cost_ + heuristic_;
58 }

◆ SetPreNode()

void apollo::planning::Node2d::SetPreNode ( std::shared_ptr< Node2d >  pre_node)
inline

在文件 grid_search.h 第 69 行定义.

69 {
70 pre_node_ = pre_node;
71 }

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