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

#include <evaluator.h>

apollo::planning::Evaluator 的协作图:

Public 成员函数

void Init ()
 
void Close ()
 
void Evaluate (const std::string &source_file)
 

详细描述

在文件 evaluator.h 第 28 行定义.

成员函数说明

◆ Close()

void apollo::planning::Evaluator::Close ( )

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

41 {
42 auto end_time = std::chrono::system_clock::now();
43 std::chrono::duration<double> elapsed_seconds = end_time - start_time_;
45 << "Time elapsed(sec): " << elapsed_seconds.count() << std::endl
46 << std::endl;
47}
static std::ofstream & GetStream()

◆ Evaluate()

void apollo::planning::Evaluator::Evaluate ( const std::string &  source_file)

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

49 {
50 EvaluatorLogger::GetStream() << "Processing: " << source_file << std::endl;
51
52 const std::string& source_filename =
53 source_file.substr(source_file.find_last_of("/") + 1);
54
55 cyber::common::GetProtoFromFile(source_file, &learning_data_);
56
57 for (int i = 0; i < learning_data_.learning_data_frame_size(); ++i) {
58 auto learning_data_frame = learning_data_.mutable_learning_data_frame(i);
59 if (learning_data_frame->adc_trajectory_point_size() <= 0) {
60 continue;
61 }
62 const double start_point_timestamp_sec =
63 learning_data_frame
64 ->adc_trajectory_point(
65 learning_data_frame->adc_trajectory_point_size() - 1)
66 .timestamp_sec();
67
68 // evaluate adc trajectory
69 trajectory_evaluator_.EvaluateADCTrajectory(start_point_timestamp_sec,
70 FLAGS_trajectory_delta_t,
71 learning_data_frame);
72
73 // evaluate adc future trajectory
74 std::vector<TrajectoryPointFeature> adc_future_trajectory;
75 for (const auto& tp : learning_data_.learning_data_frame(i)
76 .output()
77 .adc_future_trajectory_point()) {
78 adc_future_trajectory.push_back(tp);
79 }
80 std::vector<TrajectoryPointFeature> evaluated_adc_future_trajectory;
81 trajectory_evaluator_.EvaluateADCFutureTrajectory(
82 learning_data_.learning_data_frame(i).frame_num(),
83 adc_future_trajectory, start_point_timestamp_sec,
84 FLAGS_trajectory_delta_t, &evaluated_adc_future_trajectory);
85 learning_data_frame->mutable_output()->clear_adc_future_trajectory_point();
86 for (const auto& tp : evaluated_adc_future_trajectory) {
87 auto adc_future_trajectory_point =
88 learning_data_frame->mutable_output()
89 ->add_adc_future_trajectory_point();
90 adc_future_trajectory_point->set_timestamp_sec(tp.timestamp_sec());
91 adc_future_trajectory_point->mutable_trajectory_point()->CopyFrom(
92 tp.trajectory_point());
93 }
94
95 // evaluate obstacle trajectory
96 trajectory_evaluator_.EvaluateObstacleTrajectory(start_point_timestamp_sec,
97 FLAGS_trajectory_delta_t,
98 learning_data_frame);
99
100 // evaluate obstacle prediction trajectory
101 trajectory_evaluator_.EvaluateObstaclePredictionTrajectory(
102 start_point_timestamp_sec, FLAGS_trajectory_delta_t,
103 learning_data_frame);
104 }
105
106 WriteOutData(source_filename, learning_data_);
107}
void EvaluateADCFutureTrajectory(const int frame_num, const std::vector< TrajectoryPointFeature > &adc_future_trajectory, const double start_point_timestamp_sec, const double delta_time, std::vector< TrajectoryPointFeature > *evaluated_adc_future_trajectory)
void EvaluateADCTrajectory(const double start_point_timestamp_sec, const double delta_time, LearningDataFrame *learning_data_frame)
void EvaluateObstacleTrajectory(const double start_point_timestamp_sec, const double delta_time, LearningDataFrame *learning_data_frame)
void EvaluateObstaclePredictionTrajectory(const double start_point_timestamp_sec, const double delta_time, LearningDataFrame *learning_data_frame)
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...
Definition file.cc:132
repeated LearningDataFrame learning_data_frame

◆ Init()

void apollo::planning::Evaluator::Init ( )

在文件 evaluator.cc 第 33 行定义.

33 {
34 start_time_ = std::chrono::system_clock::now();
35 std::time_t now = std::time(nullptr);
37 << "UTC date and time: " << std::asctime(std::gmtime(&now))
38 << "Local date and time: " << std::asctime(std::localtime(&now));
39}

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