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

#include <constraint_checker1d.h>

apollo::planning::ConstraintChecker1d 的协作图:

Public 成员函数

 ConstraintChecker1d ()=delete
 

静态 Public 成员函数

static bool IsValidLongitudinalTrajectory (const Curve1d &lon_trajectory)
 
static bool IsValidLateralTrajectory (const Curve1d &lat_trajectory, const Curve1d &lon_trajectory)
 

详细描述

在文件 constraint_checker1d.h 第 29 行定义.

构造及析构函数说明

◆ ConstraintChecker1d()

apollo::planning::ConstraintChecker1d::ConstraintChecker1d ( )
delete

成员函数说明

◆ IsValidLateralTrajectory()

bool apollo::planning::ConstraintChecker1d::IsValidLateralTrajectory ( const Curve1d &  lat_trajectory,
const Curve1d &  lon_trajectory 
)
static

在文件 constraint_checker1d.cc 第 62 行定义.

63 {
64 double t = 0.0;
65 while (t < lon_trajectory.ParamLength()) {
66 double s = lon_trajectory.Evaluate(0, t);
67 double dd_ds = lat_trajectory.Evaluate(1, s);
68 double ds_dt = lon_trajectory.Evaluate(1, t);
69
70 double d2d_ds2 = lat_trajectory.Evaluate(2, s);
71 double d2s_dt2 = lon_trajectory.Evaluate(2, t);
72
73 double a = 0.0;
74 if (s < lat_trajectory.ParamLength()) {
75 a = d2d_ds2 * ds_dt * ds_dt + dd_ds * d2s_dt2;
76 }
77
78 if (!fuzzy_within(a, -FLAGS_lateral_acceleration_bound,
79 FLAGS_lateral_acceleration_bound)) {
80 return false;
81 }
82
83 // this is not accurate, just an approximation...
84 double j = 0.0;
85 if (s < lat_trajectory.ParamLength()) {
86 j = lat_trajectory.Evaluate(3, s) * lon_trajectory.Evaluate(3, t);
87 }
88
89 if (!fuzzy_within(j, -FLAGS_lateral_jerk_bound, FLAGS_lateral_jerk_bound)) {
90 return false;
91 }
92 t += FLAGS_trajectory_time_resolution;
93 }
94 return true;
95}

◆ IsValidLongitudinalTrajectory()

bool apollo::planning::ConstraintChecker1d::IsValidLongitudinalTrajectory ( const Curve1d &  lon_trajectory)
static

在文件 constraint_checker1d.cc 第 37 行定义.

38 {
39 double t = 0.0;
40 while (t < lon_trajectory.ParamLength()) {
41 double v = lon_trajectory.Evaluate(1, t); // evaluate_v
42 if (!fuzzy_within(v, FLAGS_speed_lower_bound, FLAGS_speed_upper_bound)) {
43 return false;
44 }
45
46 double a = lon_trajectory.Evaluate(2, t); // evaluate_a
47 if (!fuzzy_within(a, FLAGS_longitudinal_acceleration_lower_bound,
48 FLAGS_longitudinal_acceleration_upper_bound)) {
49 return false;
50 }
51
52 double j = lon_trajectory.Evaluate(3, t);
53 if (!fuzzy_within(j, FLAGS_longitudinal_jerk_lower_bound,
54 FLAGS_longitudinal_jerk_upper_bound)) {
55 return false;
56 }
57 t += FLAGS_trajectory_time_resolution;
58 }
59 return true;
60}

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