52 const std::string& source_filename =
53 source_file.substr(source_file.find_last_of(
"/") + 1);
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) {
62 const double start_point_timestamp_sec =
64 ->adc_trajectory_point(
65 learning_data_frame->adc_trajectory_point_size() - 1)
70 FLAGS_trajectory_delta_t,
74 std::vector<TrajectoryPointFeature> adc_future_trajectory;
78 adc_future_trajectory.push_back(tp);
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());
97 FLAGS_trajectory_delta_t,
102 start_point_timestamp_sec, FLAGS_trajectory_delta_t,
103 learning_data_frame);
106 WriteOutData(source_filename, learning_data_);
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)
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,...