Skip to content

Commit

Permalink
planning: add instance num stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
ycool authored and xiaoxq committed Feb 6, 2020
1 parent 0485ffe commit c518b37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions modules/planning/pipeline/feature_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ void FeatureGenerator::WriteOutInstances(const Instances& instances,
void FeatureGenerator::Close() {
const std::string file_name = absl::StrCat(
FLAGS_planning_data_dir, "/instances.", instance_file_index_, ".bin");
total_instance_num_ += instances_.instances_size();
WriteOutInstances(instances_, file_name);
++instance_file_index_;
AINFO << "Total instance number:" << total_instance_num_;
}

void FeatureGenerator::GenerateTrajectoryLabel(
Expand Down Expand Up @@ -126,6 +128,7 @@ void FeatureGenerator::OnLocalization(
const std::string file_name = absl::StrCat(
FLAGS_planning_data_dir, "/instances.", instance_file_index_, ".bin");
WriteOutInstances(instances_, file_name);
total_instance_num_ += instances_.instances_size();
instances_.Clear();
++instance_file_index_;
instance_ = instances_.add_instances();
Expand Down
4 changes: 3 additions & 1 deletion modules/planning/pipeline/feature_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class FeatureGenerator {
Instance* instance_ = nullptr; // not owned
Instances instances_;
int instance_file_index_ = 0;
std::list<apollo::localization::LocalizationEstimate> localization_for_label_;
std::list<apollo::localization::LocalizationEstimate>
localization_for_label_;
int total_instance_num_ = 0;
};

} // namespace planning
Expand Down

0 comments on commit c518b37

Please sign in to comment.