49 {
51
52 const std::string& source_filename =
53 source_file.substr(source_file.find_last_of("/") + 1);
54
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
70 FLAGS_trajectory_delta_t,
71 learning_data_frame);
72
73
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;
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
97 FLAGS_trajectory_delta_t,
98 learning_data_frame);
99
100
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,...
optional uint32 frame_num
repeated LearningDataFrame learning_data_frame