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

#include <path_boundary.h>

类 apollo::planning::PathBoundary 继承关系图:
apollo::planning::PathBoundary 的协作图:

Public 成员函数

 PathBoundary ()
 
 PathBoundary (const double start_s, const double delta_s, std::vector< std::pair< double, double > > path_boundary)
 
 PathBoundary (const double delta_s, const PathBound &path_bound)
 construct class by path bound
 
virtual ~PathBoundary ()=default
 
void set_delta_s (double s)
 
double start_s () const
 
double delta_s () const
 
void set_boundary (const std::vector< std::pair< double, double > > &boundary)
 
std::vector< std::pair< double, double > > boundary () const
 
bool get_interpolated_s_weight (const double s, double *left_weight, double *right_weight, size_t *left_index, size_t *right_index) const
 
double get_lower_bound_by_s (const double s)
 
double get_upper_bound_by_s (const double s)
 
double get_lower_bound_by_interpolated_index (double left_weight, double right_weight, size_t left_index, size_t right_index) const
 
double get_upper_bound_by_interpolated_index (double left_weight, double right_weight, size_t left_index, size_t right_index) const
 
void set_label (const std::string &label)
 
const std::string & label () const
 
void set_blocking_obstacle_id (const std::string &obs_id)
 
const std::string & blocking_obstacle_id () const
 
void DebugString (std::string name)
 
ObsCornerConstraints * mutable_extra_path_bound ()
 
const ObsCornerConstraints & extra_path_bound () const
 
ADCVertexConstraints * mutable_adc_vertex_bound ()
 
const ADCVertexConstraints & adc_vertex_bound () const
 

详细描述

在文件 path_boundary.h 第 94 行定义.

构造及析构函数说明

◆ PathBoundary() [1/3]

apollo::planning::PathBoundary::PathBoundary ( )
inline

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

96{}

◆ PathBoundary() [2/3]

apollo::planning::PathBoundary::PathBoundary ( const double  start_s,
const double  delta_s,
std::vector< std::pair< double, double > >  path_boundary 
)

◆ PathBoundary() [3/3]

apollo::planning::PathBoundary::PathBoundary ( const double  delta_s,
const PathBound &  path_bound 
)

construct class by path bound

参数
delta_sThe distance between two point in s-axis
path_boundtuple first is s, second is l_min, third is l_max

◆ ~PathBoundary()

virtual apollo::planning::PathBoundary::~PathBoundary ( )
virtualdefault

成员函数说明

◆ adc_vertex_bound()

const ADCVertexConstraints & apollo::planning::PathBoundary::adc_vertex_bound ( ) const
inline

在文件 path_boundary.h 第 141 行定义.

141 {
142 return adc_vertex_bound_;
143 }

◆ blocking_obstacle_id()

const std::string & apollo::planning::PathBoundary::blocking_obstacle_id ( ) const

在文件 path_boundary.cc 第 67 行定义.

67 {
68 return blocking_obstacle_id_;
69}

◆ boundary()

std::vector< std::pair< double, double > > apollo::planning::PathBoundary::boundary ( ) const

在文件 path_boundary.cc 第 41 行定义.

41 {
42 std::vector<std::pair<double, double>> boundary;
43 for (auto iter = begin(); iter != end(); iter++) {
44 boundary.emplace_back(iter->l_lower.l, iter->l_upper.l);
45 }
46 return boundary;
47}
std::vector< std::pair< double, double > > boundary() const

◆ DebugString()

void apollo::planning::PathBoundary::DebugString ( std::string  name)

在文件 path_boundary.cc 第 56 行定义.

56 {
57 PrintCurves print_curves;
58 std::string lower_name = name + "_lower";
59 std::string upper_name = name + "_upper";
60 for (auto iter = begin(); iter != end(); iter++) {
61 print_curves.AddPoint(lower_name, iter->s, iter->l_lower.l);
62 print_curves.AddPoint(upper_name, iter->s, iter->l_upper.l);
63 }
64 print_curves.PrintToLog();
65}

◆ delta_s()

double apollo::planning::PathBoundary::delta_s ( ) const

在文件 path_boundary.cc 第 38 行定义.

38{ return delta_s_; }

◆ extra_path_bound()

const ObsCornerConstraints & apollo::planning::PathBoundary::extra_path_bound ( ) const
inline

在文件 path_boundary.h 第 135 行定义.

135 {
136 return extra_path_bound_;
137 }

◆ get_interpolated_s_weight()

bool apollo::planning::PathBoundary::get_interpolated_s_weight ( const double  s,
double *  left_weight,
double *  right_weight,
size_t *  left_index,
size_t *  right_index 
) const

在文件 path_boundary.cc 第 71 行定义.

75 {
76 if (s < front().s || s > back().s) {
77 return false;
78 }
79 PathBoundPoint cmp(s, 0.0, 0.0);
80 const auto iter = std::lower_bound(begin(), end(), cmp);
81 auto last_iter = std::prev(iter);
82 *left_index = std::distance(begin(), last_iter);
83 *right_index = *left_index + 1;
84 if (*left_index > size() - 1 || *right_index > size() - 1) {
85 return false;
86 }
87 *left_weight =
88 (at(*right_index).s - s) / (at(*right_index).s - at(*left_index).s);
89 *right_weight = 1.0 - *left_weight;
90 return true;
91}

◆ get_lower_bound_by_interpolated_index()

double apollo::planning::PathBoundary::get_lower_bound_by_interpolated_index ( double  left_weight,
double  right_weight,
size_t  left_index,
size_t  right_index 
) const

在文件 path_boundary.cc 第 125 行定义.

127 {
128 if (left_index < 0) {
129 return front().l_lower.l;
130 } else if (right_index >= size()) {
131 return back().l_lower.l;
132 }
133 return at(left_index).l_lower.l * left_weight +
134 at(right_index).l_lower.l * right_weight;
135}

◆ get_lower_bound_by_s()

double apollo::planning::PathBoundary::get_lower_bound_by_s ( const double  s)

在文件 path_boundary.cc 第 93 行定义.

93 {
94 if (s <= front().s) {
95 return front().l_lower.l;
96 }
97 if (s >= back().s) {
98 return back().l_lower.l;
99 }
100 double l_weight = 0.0;
101 double r_weight = 0.0;
102 size_t l_index = 0;
103 size_t r_index = 0;
104 get_interpolated_s_weight(s, &l_weight, &r_weight, &l_index, &r_index);
105
106 return at(l_index).l_lower.l * l_weight + at(r_index).l_lower.l * r_weight;
107}
bool get_interpolated_s_weight(const double s, double *left_weight, double *right_weight, size_t *left_index, size_t *right_index) const

◆ get_upper_bound_by_interpolated_index()

double apollo::planning::PathBoundary::get_upper_bound_by_interpolated_index ( double  left_weight,
double  right_weight,
size_t  left_index,
size_t  right_index 
) const

在文件 path_boundary.cc 第 137 行定义.

139 {
140 if (left_index < 0) {
141 return front().l_upper.l;
142 } else if (right_index >= size()) {
143 return back().l_upper.l;
144 }
145 return at(left_index).l_upper.l * left_weight +
146 at(right_index).l_upper.l * right_weight;
147}

◆ get_upper_bound_by_s()

double apollo::planning::PathBoundary::get_upper_bound_by_s ( const double  s)

在文件 path_boundary.cc 第 109 行定义.

109 {
110 if (s <= front().s) {
111 return front().l_upper.l;
112 }
113 if (s >= back().s) {
114 return back().l_upper.l;
115 }
116 double l_weight = 0.0;
117 double r_weight = 0.0;
118 size_t l_index = 0;
119 size_t r_index = 0;
120 get_interpolated_s_weight(s, &l_weight, &r_weight, &l_index, &r_index);
121
122 return at(l_index).l_upper.l * l_weight + at(r_index).l_upper.l * r_weight;
123}

◆ label()

const std::string & apollo::planning::PathBoundary::label ( ) const

在文件 path_boundary.cc 第 51 行定义.

51{ return label_; }

◆ mutable_adc_vertex_bound()

ADCVertexConstraints * apollo::planning::PathBoundary::mutable_adc_vertex_bound ( )
inline

在文件 path_boundary.h 第 138 行定义.

138 {
139 return &adc_vertex_bound_;
140 }

◆ mutable_extra_path_bound()

ObsCornerConstraints * apollo::planning::PathBoundary::mutable_extra_path_bound ( )
inline

在文件 path_boundary.h 第 132 行定义.

132 {
133 return &extra_path_bound_;
134 }

◆ set_blocking_obstacle_id()

void apollo::planning::PathBoundary::set_blocking_obstacle_id ( const std::string &  obs_id)

在文件 path_boundary.cc 第 53 行定义.

53 {
54 blocking_obstacle_id_ = obs_id;
55}

◆ set_boundary()

void apollo::planning::PathBoundary::set_boundary ( const std::vector< std::pair< double, double > > &  boundary)

◆ set_delta_s()

void apollo::planning::PathBoundary::set_delta_s ( double  s)

在文件 path_boundary.cc 第 39 行定义.

39{ delta_s_ = s; }

◆ set_label()

void apollo::planning::PathBoundary::set_label ( const std::string &  label)

在文件 path_boundary.cc 第 49 行定义.

49{ label_ = label; }
const std::string & label() const

◆ start_s()

double apollo::planning::PathBoundary::start_s ( ) const

在文件 path_boundary.cc 第 30 行定义.

30 {
31 if (size() == 0) {
32 return 0;
33 } else {
34 return begin()->s;
35 }
36}

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