Skip to content

Commit

Permalink
fixup! feat(perception_online_evaluator): publish metrics of each obj…
Browse files Browse the repository at this point in the history
…ect class
  • Loading branch information
kosuke55 committed Mar 6, 2024
1 parent 40f3796 commit 5dd8c49
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions evaluator/perception_online_evaluator/src/metrics_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ std::optional<MetricStatMap> MetricsCalculator::calculate(const Metric & metric)
}
const auto target_objects = getObjectsByStamp(target_stamp);
const ClassObjectsMap class_objects_map = separateObjectsByClass(target_objects);

// print class and size
for (const auto [label, objects] : class_objects_map) {
}

switch (metric) {
case Metric::lateral_deviation:
return calcLateralDeviationMetrics(class_objects_map);
Expand Down Expand Up @@ -166,7 +161,7 @@ MetricStatMap MetricsCalculator::calcLateralDeviationMetrics(
const ClassObjectsMap & class_objects_map) const
{
MetricStatMap metric_stat_map{};
for (const auto [label, objects] : class_objects_map) {
for (const auto & [label, objects] : class_objects_map) {
Stat<double> stat{};
const auto stamp = rclcpp::Time(objects.header.stamp);
for (const auto & object : objects.objects) {
Expand All @@ -190,7 +185,7 @@ MetricStatMap MetricsCalculator::calcYawDeviationMetrics(
const ClassObjectsMap & class_objects_map) const
{
MetricStatMap metric_stat_map{};
for (const auto [label, objects] : class_objects_map) {
for (const auto & [label, objects] : class_objects_map) {
Stat<double> stat{};
const auto stamp = rclcpp::Time(objects.header.stamp);
for (const auto & object : objects.objects) {
Expand All @@ -216,7 +211,7 @@ MetricStatMap MetricsCalculator::calcPredictedPathDeviationMetrics(
const auto time_horizons = parameters_->prediction_time_horizons;

MetricStatMap metric_stat_map{};
for (const auto [label, objects] : class_objects_map) {
for (const auto & [label, objects] : class_objects_map) {
for (const double time_horizon : time_horizons) {
const auto stat = calcPredictedPathDeviationMetrics(objects, time_horizon);
std::ostringstream stream;
Expand Down

0 comments on commit 5dd8c49

Please sign in to comment.