Apollo 10.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< Node2dGetPreNode () 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.h42 行定义.

构造及析构函数说明

◆ 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.h44 行定义.

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

◆ Node2d() [2/2]

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

在文件 grid_search.h51 行定义.

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

成员函数说明

◆ 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.h80 行定义.

82 {
83 // XYbounds with xmin, xmax, ymin, ymax
84 int grid_x = static_cast<int>((x - XYbounds[0]) / xy_resolution);
85 int grid_y = static_cast<int>((y - XYbounds[2]) / xy_resolution);
86 return ComputeStringIndex(grid_x, grid_y);
87 }

◆ GetCost()

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

在文件 grid_search.h74 行定义.

74{ return cost_; }

◆ GetDistanceToObstacle()

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

在文件 grid_search.h75 行定义.

75 {
76 return distance_to_obstacle_;
77 }

◆ GetGridX()

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

在文件 grid_search.h70 行定义.

70{ return grid_x_; }

◆ GetGridY()

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

在文件 grid_search.h71 行定义.

71{ return grid_y_; }

◆ GetHeuCost()

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

在文件 grid_search.h73 行定义.

73{ return heuristic_; }

◆ GetIndex()

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

在文件 grid_search.h78 行定义.

78{ return index_; }

◆ GetPathCost()

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

在文件 grid_search.h72 行定义.

72{ return path_cost_; }

◆ GetPreNode()

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

在文件 grid_search.h79 行定义.

79{ return pre_node_; }

◆ operator==()

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

在文件 grid_search.h88 行定义.

88 {
89 return right.GetIndex() == index_;
90 }

◆ SetCost()

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

在文件 grid_search.h65 行定义.

65{ cost_ = cost; }

◆ SetDistanceToObstacle()

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

在文件 grid_search.h66 行定义.

66 {
67 distance_to_obstacle_ = dist;
68 }

◆ SetHeuristic()

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

在文件 grid_search.h61 行定义.

61 {
62 heuristic_ = heuristic;
63 cost_ = path_cost_ + heuristic_;
64 }

◆ SetPathCost()

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

在文件 grid_search.h57 行定义.

57 {
58 path_cost_ = path_cost;
59 cost_ = path_cost_ + heuristic_;
60 }

◆ SetPreNode()

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

在文件 grid_search.h69 行定义.

69{ pre_node_ = pre_node; }

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