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

#include <feature_output.h>

apollo::planning::FeatureOutput 的协作图:

Public 成员函数

 FeatureOutput ()=delete
 Constructor; disabled
 

静态 Public 成员函数

static void Close ()
 Close the output stream
 
static void Clear ()
 Reset
 
static bool Ready ()
 Check if output is ready
 
static void InsertLearningDataFrame (const std::string &record_filename, const LearningDataFrame &learning_data_frame)
 Insert a a frame of learning data
 
static void InsertPlanningResult ()
 
static LearningDataFrame * GetLatestLearningDataFrame ()
 
static void WriteLearningData (const std::string &record_file)
 Write LearningData to a file
 
static void WriteRemainderiLearningData (const std::string &record_file)
 
static int SizeOfLearningData ()
 Get the size of learning_data_
 

详细描述

在文件 feature_output.h 第 26 行定义.

构造及析构函数说明

◆ FeatureOutput()

apollo::planning::FeatureOutput::FeatureOutput ( )
delete

Constructor; disabled

成员函数说明

◆ Clear()

void apollo::planning::FeatureOutput::Clear ( )
static

Reset

在文件 feature_output.cc 第 32 行定义.

32 {
33 learning_data_.Clear();
34 learning_data_file_index_ = 0;
35}

◆ Close()

void apollo::planning::FeatureOutput::Close ( )
static

Close the output stream

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

30{ Clear(); }

◆ GetLatestLearningDataFrame()

LearningDataFrame * apollo::planning::FeatureOutput::GetLatestLearningDataFrame ( )
static

在文件 feature_output.cc 第 54 行定义.

54 {
55 const int size = learning_data_.learning_data_frame_size();
56 return size > 0 ? learning_data_.mutable_learning_data_frame(size - 1)
57 : nullptr;
58}

◆ InsertLearningDataFrame()

void apollo::planning::FeatureOutput::InsertLearningDataFrame ( const std::string &  record_filename,
const LearningDataFrame &  learning_data_frame 
)
static

Insert a a frame of learning data

参数
Afeature in proto

在文件 feature_output.cc 第 42 行定义.

44 {
45 learning_data_.add_learning_data_frame()->CopyFrom(learning_data_frame);
46
47 // write frames into a file
48 if (learning_data_.learning_data_frame_size() >=
49 FLAGS_learning_data_frame_num_per_file) {
50 WriteLearningData(record_file);
51 }
52}
static void WriteLearningData(const std::string &record_file)
Write LearningData to a file

◆ InsertPlanningResult()

void apollo::planning::FeatureOutput::InsertPlanningResult ( )
static

在文件 feature_output.cc 第 60 行定义.

60{}

◆ Ready()

bool apollo::planning::FeatureOutput::Ready ( )
static

Check if output is ready

返回
True if output is ready

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

37 {
38 Clear();
39 return true;
40}

◆ SizeOfLearningData()

static int apollo::planning::FeatureOutput::SizeOfLearningData ( )
static

Get the size of learning_data_

返回
The size of learning_data_

◆ WriteLearningData()

void apollo::planning::FeatureOutput::WriteLearningData ( const std::string &  record_file)
static

Write LearningData to a file

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

62 {
63 std::string src_file_name =
64 record_file.substr(record_file.find_last_of("/") + 1);
65 src_file_name = src_file_name.empty() ? "00000" : src_file_name;
66 const std::string dest_file =
67 absl::StrCat(FLAGS_planning_data_dir, "/", src_file_name, ".",
68 learning_data_file_index_, ".bin");
69 cyber::common::SetProtoToBinaryFile(learning_data_, dest_file);
70 // cyber::common::SetProtoToASCIIFile(learning_data_, dest_file + ".txt");
71 learning_data_.Clear();
72 learning_data_file_index_++;
73}
bool SetProtoToBinaryFile(const google::protobuf::Message &message, const std::string &file_name)
Sets the content of the file specified by the file_name to be the binary representation of the input ...
Definition file.cc:111

◆ WriteRemainderiLearningData()

void apollo::planning::FeatureOutput::WriteRemainderiLearningData ( const std::string &  record_file)
static

在文件 feature_output.cc 第 75 行定义.

76 {
77 if (learning_data_.learning_data_frame_size() > 0) {
78 WriteLearningData(record_file);
79 }
80}

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