Apollo 10.0
自动驾驶开放平台
apollo::prediction::ValidationChecker类 参考

#include <validation_checker.h>

apollo::prediction::ValidationChecker 的协作图:

静态 Public 成员函数

static double ProbabilityByCentripetalAcceleration (const LaneSequence &lane_sequence, const double speed)
 Compute the probability by centripetal acceleration
 
static bool ValidCentripetalAcceleration (const std::vector< common::TrajectoryPoint > &discretized_trajectory)
 Check the validity of trajectory's centripetal acceleration
 
static bool ValidTrajectoryPoint (const common::TrajectoryPoint &trajectory_point)
 Check if a trajectory point is valid
 

详细描述

在文件 validation_checker.h30 行定义.

成员函数说明

◆ ProbabilityByCentripetalAcceleration()

double apollo::prediction::ValidationChecker::ProbabilityByCentripetalAcceleration ( const LaneSequence lane_sequence,
const double  speed 
)
static

Compute the probability by centripetal acceleration

参数
lanesequence
currentspeed of obstacle
返回
probability

在文件 validation_checker.cc27 行定义.

28 {
29 double centripetal_acc_cost_sum = 0.0;
30 double centripetal_acc_cost_sqr_sum = 0.0;
31 for (int i = 0; i < lane_sequence.path_point_size(); ++i) {
32 const auto& path_point = lane_sequence.path_point(i);
33 double centripetal_acc = speed * speed * std::fabs(path_point.kappa());
34 double centripetal_acc_cost =
35 centripetal_acc / FLAGS_centripedal_acc_threshold;
36 centripetal_acc_cost_sum += centripetal_acc_cost;
37 centripetal_acc_cost_sqr_sum += centripetal_acc_cost * centripetal_acc_cost;
38 }
39 double mean_cost = centripetal_acc_cost_sqr_sum /
40 (centripetal_acc_cost_sum + FLAGS_double_precision);
41 return std::exp(-FLAGS_centripetal_acc_coeff * mean_cost);
42}

◆ ValidCentripetalAcceleration()

bool apollo::prediction::ValidationChecker::ValidCentripetalAcceleration ( const std::vector< common::TrajectoryPoint > &  discretized_trajectory)
static

Check the validity of trajectory's centripetal acceleration

参数
Thediscretized trajectory
返回
The validity of trajectory's centripetal acceleration

在文件 validation_checker.cc44 行定义.

45 {
46 for (size_t i = 0; i + 1 < trajectory_points.size(); ++i) {
47 const auto& p0 = trajectory_points[i];
48 const auto& p1 = trajectory_points[i + 1];
49 double time_diff = std::abs(p1.relative_time() - p0.relative_time());
50 if (time_diff < FLAGS_double_precision) {
51 continue;
52 }
53
54 double theta_diff = std::abs(common::math::NormalizeAngle(
55 p1.path_point().theta() - p0.path_point().theta()));
56 double v = (p0.v() + p1.v()) * 0.5;
57 double angular_a = v * theta_diff / time_diff;
58 if (angular_a > FLAGS_centripedal_acc_threshold) {
59 return false;
60 }
61 }
62 return true;
63}
double NormalizeAngle(const double angle)
Normalize angle to [-PI, PI).
Definition math_utils.cc:53

◆ ValidTrajectoryPoint()

bool apollo::prediction::ValidationChecker::ValidTrajectoryPoint ( const common::TrajectoryPoint trajectory_point)
static

Check if a trajectory point is valid

参数
Atrajectory point
返回
True if the trajectory point is valid

在文件 validation_checker.cc65 行定义.

66 {
67 return trajectory_point.has_path_point() &&
68 (!std::isnan(trajectory_point.path_point().x())) &&
69 (!std::isnan(trajectory_point.path_point().y())) &&
70 (!std::isnan(trajectory_point.path_point().theta())) &&
71 (!std::isnan(trajectory_point.v())) &&
72 (!std::isnan(trajectory_point.a())) &&
73 (!std::isnan(trajectory_point.relative_time()));
74}

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