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

#include <cost_evaluator.h>

类 apollo::prediction::CostEvaluator 继承关系图:
apollo::prediction::CostEvaluator 的协作图:

Public 成员函数

 CostEvaluator ()
 Constructor
 
virtual ~CostEvaluator ()=default
 Destructor
 
bool Evaluate (Obstacle *obstacle_ptr, ObstaclesContainer *obstacles_container) override
 Override Evaluate
 
std::string GetName () override
 Get the name of evaluator.
 
- Public 成员函数 继承自 apollo::prediction::Evaluator
 Evaluator ()=default
 Constructor
 
virtual ~Evaluator ()=default
 Destructor
 
virtual bool Evaluate (Obstacle *obstacle, ObstaclesContainer *obstacles_container, std::vector< Obstacle * > dynamic_env)
 Evaluate an obstacle
 
virtual bool Evaluate (const ADCTrajectoryContainer *adc_trajectory_container, Obstacle *obstacle, ObstaclesContainer *obstacles_container)
 Evaluate an obstacle
 

额外继承的成员函数

- Protected 成员函数 继承自 apollo::prediction::Evaluator
std::pair< double, double > WorldCoordToObjCoord (std::pair< double, double > input_world_coord, std::pair< double, double > obj_world_coord, double obj_world_angle)
 
std::pair< double, double > WorldCoordToObjCoordNorth (std::pair< double, double > input_world_coord, std::pair< double, double > obj_world_coord, double obj_world_angle)
 
double WorldAngleToObjAngle (double input_world_angle, double obj_world_angle)
 
Eigen::MatrixXf VectorToMatrixXf (const std::vector< double > &nums, const int start_index, const int end_index)
 
Eigen::MatrixXf VectorToMatrixXf (const std::vector< double > &nums, const int start_index, const int end_index, const int output_num_row, const int output_num_col)
 
- Protected 属性 继承自 apollo::prediction::Evaluator
ObstacleConf::EvaluatorType evaluator_type_
 

详细描述

在文件 cost_evaluator.h28 行定义.

构造及析构函数说明

◆ CostEvaluator()

apollo::prediction::CostEvaluator::CostEvaluator ( )

Constructor

在文件 cost_evaluator.cc23 行定义.

◆ ~CostEvaluator()

virtual apollo::prediction::CostEvaluator::~CostEvaluator ( )
virtualdefault

Destructor

成员函数说明

◆ Evaluate()

bool apollo::prediction::CostEvaluator::Evaluate ( Obstacle obstacle_ptr,
ObstaclesContainer obstacles_container 
)
overridevirtual

Override Evaluate

参数
Obstaclepointer
Obstaclescontainer

实现了 apollo::prediction::Evaluator.

在文件 cost_evaluator.cc27 行定义.

28 {
29 CHECK_NOTNULL(obstacle_ptr);
30
31 obstacle_ptr->SetEvaluatorType(evaluator_type_);
32
33 int id = obstacle_ptr->id();
34 if (!obstacle_ptr->latest_feature().IsInitialized()) {
35 AERROR << "Obstacle [" << id << "] has no latest feature.";
36 return false;
37 }
38
39 Feature* latest_feature_ptr = obstacle_ptr->mutable_latest_feature();
40 CHECK_NOTNULL(latest_feature_ptr);
41 if (!latest_feature_ptr->has_lane() ||
42 !latest_feature_ptr->lane().has_lane_graph()) {
43 ADEBUG << "Obstacle [" << id << "] has no lane graph.";
44 return false;
45 }
46
47 double obstacle_length = 0.0;
48 if (latest_feature_ptr->has_length()) {
49 obstacle_length = latest_feature_ptr->length();
50 }
51 double obstacle_width = 0.0;
52 if (latest_feature_ptr->has_width()) {
53 obstacle_width = latest_feature_ptr->width();
54 }
55
56 LaneGraph* lane_graph_ptr =
57 latest_feature_ptr->mutable_lane()->mutable_lane_graph();
58 CHECK_NOTNULL(lane_graph_ptr);
59 if (lane_graph_ptr->lane_sequence().empty()) {
60 AERROR << "Obstacle [" << id << "] has no lane sequences.";
61 return false;
62 }
63
64 for (int i = 0; i < lane_graph_ptr->lane_sequence_size(); ++i) {
65 LaneSequence* lane_sequence_ptr = lane_graph_ptr->mutable_lane_sequence(i);
66 CHECK_NOTNULL(lane_sequence_ptr);
67 double probability =
68 ComputeProbability(obstacle_length, obstacle_width, *lane_sequence_ptr);
69 lane_sequence_ptr->set_probability(probability);
70 }
71 return true;
72}
#define ADEBUG
Definition log.h:41
#define AERROR
Definition log.h:44

◆ GetName()

std::string apollo::prediction::CostEvaluator::GetName ( )
inlineoverridevirtual

Get the name of evaluator.

实现了 apollo::prediction::Evaluator.

在文件 cost_evaluator.h51 行定义.

51{ return "COST_EVALUATOR"; }

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