Skip to content

Commit b7501b0

Browse files
Merge branch 'main' into feat/add_nerf_based_localizer
2 parents 4e756f0 + 71c5669 commit b7501b0

File tree

67 files changed

+1090
-475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1090
-475
lines changed

.github/workflows/build-and-test-self-hosted.yaml .github/workflows/build-and-test-arm64.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: build-and-test-self-hosted
1+
name: build-and-test-arm64
22

33
on:
44
schedule:
55
- cron: 0 0 * * *
66
workflow_dispatch:
77

88
jobs:
9-
build-and-test-self-hosted:
9+
build-and-test-arm64:
1010
runs-on: [self-hosted, linux, ARM64]
1111
container: ${{ matrix.container }}${{ matrix.container-suffix }}
1212
strategy:
@@ -19,12 +19,15 @@ jobs:
1919
- -cuda
2020
include:
2121
- rosdistro: humble
22-
container: ghcr.io/autowarefoundation/autoware-universe:humble-latest
22+
container: ghcr.io/autowarefoundation/autoware-openadk:latest-prebuilt
2323
build-depends-repos: build_depends.repos
2424
steps:
2525
- name: Check out repository
2626
uses: actions/checkout@v3
2727

28+
- name: Show disk space before the tasks
29+
run: df -h
30+
2831
- name: Remove exec_depend
2932
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
3033

@@ -47,3 +50,6 @@ jobs:
4750
rosdistro: ${{ matrix.rosdistro }}
4851
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
4952
build-depends-repos: ${{ matrix.build-depends-repos }}
53+
54+
- name: Show disk space after the tasks
55+
run: df -h

.github/workflows/build-and-test-differential-self-hosted.yaml .github/workflows/build-and-test-differential-arm64.yaml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-and-test-differential-self-hosted
1+
name: build-and-test-differential-arm64
22

33
on:
44
pull_request:
@@ -12,9 +12,9 @@ jobs:
1212
prevent-no-label-execution:
1313
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
1414
with:
15-
label: ARM64
15+
label: type:arm64
1616

17-
build-and-test-differential-self-hosted:
17+
build-and-test-differential-arm64:
1818
needs: prevent-no-label-execution
1919
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
2020
runs-on: [self-hosted, linux, ARM64]
@@ -29,14 +29,17 @@ jobs:
2929
- -cuda
3030
include:
3131
- rosdistro: humble
32-
container: ghcr.io/autowarefoundation/autoware-universe:humble-latest
32+
container: ghcr.io/autowarefoundation/autoware-openadk:latest-prebuilt
3333
build-depends-repos: build_depends.repos
3434
steps:
3535
- name: Check out repository
3636
uses: actions/checkout@v3
3737
with:
3838
fetch-depth: 0
3939

40+
- name: Show disk space before the tasks
41+
run: df -h
42+
4043
- name: Remove exec_depend
4144
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
4245

@@ -59,3 +62,6 @@ jobs:
5962
rosdistro: ${{ matrix.rosdistro }}
6063
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
6164
build-depends-repos: ${{ matrix.build-depends-repos }}
65+
66+
- name: Show disk space after the tasks
67+
run: df -h

.github/workflows/build-and-test-differential.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,27 @@ jobs:
1616
build-and-test-differential:
1717
needs: prevent-no-label-execution
1818
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
19-
runs-on: [self-hosted, linux, X64]
19+
runs-on: ubuntu-latest
2020
container: ${{ matrix.container }}${{ matrix.container-suffix }}
2121
strategy:
2222
fail-fast: false
2323
matrix:
2424
rosdistro:
2525
- humble
2626
container-suffix:
27+
- ""
2728
- -cuda
2829
include:
2930
- rosdistro: humble
30-
container: ghcr.io/autowarefoundation/autoware-universe:humble-latest
31+
container: ghcr.io/autowarefoundation/autoware-openadk:latest-prebuilt
3132
build-depends-repos: build_depends.repos
3233
steps:
3334
- name: Check out repository
3435
uses: actions/checkout@v3
3536
with:
3637
fetch-depth: 0
3738

38-
- name: Check disk space before build
39+
- name: Show disk space before the tasks
3940
run: df -h
4041

4142
- name: Remove exec_depend
@@ -71,5 +72,5 @@ jobs:
7172
verbose: true
7273
flags: differential
7374

74-
- name: Check disk space after build
75+
- name: Show disk space after the tasks
7576
run: df -h

.github/workflows/build-and-test.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build-and-test:
1111
if: ${{ github.event_name != 'push' || github.ref_name == github.event.repository.default_branch }}
12-
runs-on: [self-hosted, linux, X64]
12+
runs-on: ubuntu-latest
1313
container: ${{ matrix.container }}${{ matrix.container-suffix }}
1414
strategy:
1515
fail-fast: false
@@ -21,12 +21,15 @@ jobs:
2121
- -cuda
2222
include:
2323
- rosdistro: humble
24-
container: ghcr.io/autowarefoundation/autoware-universe:humble-latest
24+
container: ghcr.io/autowarefoundation/autoware-openadk:latest-prebuilt
2525
build-depends-repos: build_depends.repos
2626
steps:
2727
- name: Check out repository
2828
uses: actions/checkout@v3
2929

30+
- name: Show disk space before the tasks
31+
run: df -h
32+
3033
- name: Remove exec_depend
3134
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1
3235

@@ -59,3 +62,6 @@ jobs:
5962
fail_ci_if_error: false
6063
verbose: true
6164
flags: total
65+
66+
- name: Show disk space after the tasks
67+
run: df -h

evaluator/perception_online_evaluator/include/perception_online_evaluator/metrics_calculator.hpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "perception_online_evaluator/metrics/metric.hpp"
2020
#include "perception_online_evaluator/parameters.hpp"
2121
#include "perception_online_evaluator/stat.hpp"
22+
#include "perception_online_evaluator/utils/objects_filtering.hpp"
2223

2324
#include <rclcpp/time.hpp>
2425

@@ -118,9 +119,9 @@ class MetricsCalculator
118119
void deleteOldObjects(const rclcpp::Time stamp);
119120

120121
// Calculate metrics
121-
MetricStatMap calcLateralDeviationMetrics(const PredictedObjects & objects) const;
122-
MetricStatMap calcYawDeviationMetrics(const PredictedObjects & objects) const;
123-
MetricStatMap calcPredictedPathDeviationMetrics(const PredictedObjects & objects) const;
122+
MetricStatMap calcLateralDeviationMetrics(const ClassObjectsMap & class_objects_map) const;
123+
MetricStatMap calcYawDeviationMetrics(const ClassObjectsMap & class_objects_map) const;
124+
MetricStatMap calcPredictedPathDeviationMetrics(const ClassObjectsMap & class_objects_map) const;
124125
Stat<double> calcPredictedPathDeviationMetrics(
125126
const PredictedObjects & objects, const double time_horizon) const;
126127

evaluator/perception_online_evaluator/include/perception_online_evaluator/utils/objects_filtering.hpp

+10
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ using autoware_auto_perception_msgs::msg::ObjectClassification;
3737
using autoware_auto_perception_msgs::msg::PredictedObject;
3838
using autoware_auto_perception_msgs::msg::PredictedObjects;
3939

40+
using ClassObjectsMap = std::unordered_map<uint8_t, PredictedObjects>;
41+
4042
std::uint8_t getHighestProbLabel(const std::vector<ObjectClassification> & classification);
4143

4244
/**
@@ -105,6 +107,14 @@ void filterObjects(PredictedObjects & objects, Func filter)
105107
filterObjects(objects, removed_objects, filter);
106108
}
107109

110+
/**
111+
* @brief Separates the provided objects based on their classification.
112+
*
113+
* @param objects The predicted objects to be separated.
114+
* @return A map of objects separated by their classification.
115+
*/
116+
ClassObjectsMap separateObjectsByClass(const PredictedObjects & objects);
117+
108118
/**
109119
* @brief Filters the provided objects based on their classification.
110120
*

evaluator/perception_online_evaluator/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<depend>libgoogle-glog-dev</depend>
2525
<depend>motion_utils</depend>
2626
<depend>nav_msgs</depend>
27+
<depend>object_recognition_utils</depend>
2728
<depend>pluginlib</depend>
2829
<depend>rclcpp</depend>
2930
<depend>rclcpp_components</depend>

evaluator/perception_online_evaluator/src/metrics_calculator.cpp

+54-47
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
#include "perception_online_evaluator/metrics_calculator.hpp"
1616

1717
#include "motion_utils/trajectory/trajectory.hpp"
18-
#include "perception_online_evaluator/utils/objects_filtering.hpp"
18+
#include "object_recognition_utils/object_recognition_utils.hpp"
1919
#include "tier4_autoware_utils/geometry/geometry.hpp"
2020

2121
#include <tier4_autoware_utils/ros/uuid_helper.hpp>
2222

2323
namespace perception_diagnostics
2424
{
25+
using object_recognition_utils::convertLabelToString;
26+
2527
std::optional<MetricStatMap> MetricsCalculator::calculate(const Metric & metric) const
2628
{
2729
if (object_map_.empty()) {
@@ -35,14 +37,14 @@ std::optional<MetricStatMap> MetricsCalculator::calculate(const Metric & metric)
3537
return {};
3638
}
3739
const auto target_objects = getObjectsByStamp(target_stamp);
38-
40+
const ClassObjectsMap class_objects_map = separateObjectsByClass(target_objects);
3941
switch (metric) {
4042
case Metric::lateral_deviation:
41-
return calcLateralDeviationMetrics(target_objects);
43+
return calcLateralDeviationMetrics(class_objects_map);
4244
case Metric::yaw_deviation:
43-
return calcYawDeviationMetrics(target_objects);
45+
return calcYawDeviationMetrics(class_objects_map);
4446
case Metric::predicted_path_deviation:
45-
return calcPredictedPathDeviationMetrics(target_objects);
47+
return calcPredictedPathDeviationMetrics(class_objects_map);
4648
default:
4749
return {};
4850
}
@@ -155,65 +157,70 @@ PredictedObjects MetricsCalculator::getObjectsByStamp(const rclcpp::Time stamp)
155157
return objects;
156158
}
157159

158-
MetricStatMap MetricsCalculator::calcLateralDeviationMetrics(const PredictedObjects & objects) const
160+
MetricStatMap MetricsCalculator::calcLateralDeviationMetrics(
161+
const ClassObjectsMap & class_objects_map) const
159162
{
160-
Stat<double> stat{};
161-
const auto stamp = rclcpp::Time(objects.header.stamp);
162-
163-
for (const auto & object : objects.objects) {
164-
const auto uuid = tier4_autoware_utils::toHexString(object.object_id);
165-
if (!hasPassedTime(uuid, stamp)) {
166-
continue;
167-
}
168-
const auto object_pose = object.kinematics.initial_pose_with_covariance.pose;
169-
const auto history_path = history_path_map_.at(uuid).second;
170-
if (history_path.empty()) {
171-
continue;
163+
MetricStatMap metric_stat_map{};
164+
for (const auto & [label, objects] : class_objects_map) {
165+
Stat<double> stat{};
166+
const auto stamp = rclcpp::Time(objects.header.stamp);
167+
for (const auto & object : objects.objects) {
168+
const auto uuid = tier4_autoware_utils::toHexString(object.object_id);
169+
if (!hasPassedTime(uuid, stamp)) {
170+
continue;
171+
}
172+
const auto object_pose = object.kinematics.initial_pose_with_covariance.pose;
173+
const auto history_path = history_path_map_.at(uuid).second;
174+
if (history_path.empty()) {
175+
continue;
176+
}
177+
stat.add(metrics::calcLateralDeviation(history_path, object_pose));
172178
}
173-
stat.add(metrics::calcLateralDeviation(history_path, object_pose));
179+
metric_stat_map["lateral_deviation_" + convertLabelToString(label)] = stat;
174180
}
175-
176-
MetricStatMap metric_stat_map;
177-
metric_stat_map["lateral_deviation"] = stat;
178181
return metric_stat_map;
179182
}
180183

181-
MetricStatMap MetricsCalculator::calcYawDeviationMetrics(const PredictedObjects & objects) const
184+
MetricStatMap MetricsCalculator::calcYawDeviationMetrics(
185+
const ClassObjectsMap & class_objects_map) const
182186
{
183-
Stat<double> stat{};
184-
const auto stamp = rclcpp::Time(objects.header.stamp);
185-
for (const auto & object : objects.objects) {
186-
const auto uuid = tier4_autoware_utils::toHexString(object.object_id);
187-
if (!hasPassedTime(uuid, stamp)) {
188-
continue;
189-
}
190-
const auto object_pose = object.kinematics.initial_pose_with_covariance.pose;
191-
const auto history_path = history_path_map_.at(uuid).second;
192-
if (history_path.empty()) {
193-
continue;
187+
MetricStatMap metric_stat_map{};
188+
for (const auto & [label, objects] : class_objects_map) {
189+
Stat<double> stat{};
190+
const auto stamp = rclcpp::Time(objects.header.stamp);
191+
for (const auto & object : objects.objects) {
192+
const auto uuid = tier4_autoware_utils::toHexString(object.object_id);
193+
if (!hasPassedTime(uuid, stamp)) {
194+
continue;
195+
}
196+
const auto object_pose = object.kinematics.initial_pose_with_covariance.pose;
197+
const auto history_path = history_path_map_.at(uuid).second;
198+
if (history_path.empty()) {
199+
continue;
200+
}
201+
stat.add(metrics::calcYawDeviation(history_path, object_pose));
194202
}
195-
stat.add(metrics::calcYawDeviation(history_path, object_pose));
203+
metric_stat_map["yaw_deviation_" + convertLabelToString(label)] = stat;
196204
}
197-
198-
MetricStatMap metric_stat_map;
199-
metric_stat_map["yaw_deviation"] = stat;
200205
return metric_stat_map;
201206
}
202207

203208
MetricStatMap MetricsCalculator::calcPredictedPathDeviationMetrics(
204-
const PredictedObjects & objects) const
209+
const ClassObjectsMap & class_objects_map) const
205210
{
206211
const auto time_horizons = parameters_->prediction_time_horizons;
207212

208-
MetricStatMap metric_stat_map;
209-
for (const double time_horizon : time_horizons) {
210-
const auto stat = calcPredictedPathDeviationMetrics(objects, time_horizon);
211-
std::ostringstream stream;
212-
stream << std::fixed << std::setprecision(2) << time_horizon;
213-
std::string time_horizon_str = stream.str();
214-
metric_stat_map["predicted_path_deviation_" + time_horizon_str] = stat;
213+
MetricStatMap metric_stat_map{};
214+
for (const auto & [label, objects] : class_objects_map) {
215+
for (const double time_horizon : time_horizons) {
216+
const auto stat = calcPredictedPathDeviationMetrics(objects, time_horizon);
217+
std::ostringstream stream;
218+
stream << std::fixed << std::setprecision(2) << time_horizon;
219+
std::string time_horizon_str = stream.str();
220+
metric_stat_map
221+
["predicted_path_deviation_" + convertLabelToString(label) + "_" + time_horizon_str] = stat;
222+
}
215223
}
216-
217224
return metric_stat_map;
218225
}
219226

evaluator/perception_online_evaluator/src/utils/objects_filtering.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ bool isTargetObjectType(
8383
(t == ObjectClassification::PEDESTRIAN && target_object_types.check_pedestrian));
8484
}
8585

86+
ClassObjectsMap separateObjectsByClass(const PredictedObjects & objects)
87+
{
88+
ClassObjectsMap separated_objects;
89+
for (const auto & object : objects.objects) {
90+
const auto label = getHighestProbLabel(object.classification);
91+
separated_objects[label].objects.push_back(object);
92+
separated_objects[label].header = objects.header;
93+
}
94+
return separated_objects;
95+
}
96+
8697
void filterObjectsByClass(
8798
PredictedObjects & objects, const ObjectTypesToCheck & target_object_types)
8899
{

0 commit comments

Comments
 (0)