Skip to content

Commit a24d4a2

Browse files
committed
feat: add stopped vel parameter
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
1 parent 8491516 commit a24d4a2

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

evaluator/perception_online_evaluator/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This module allows for the evaluation of how accurately perception results are g
2727
| `selected_metrics` | List | Metrics to be evaluated, such as lateral deviation, yaw deviation, and predicted path deviation. |
2828
| `smoothing_window_size` | Integer | Determines the window size for smoothing path, should be an odd number. |
2929
| `prediction_time_horizons` | list[double] | Time horizons for prediction evaluation in seconds. |
30+
| `stopped_velocity_threshold` | double | threshold velocity to check if vehicle is stopped |
3031
| `target_object.*.check_deviation` | bool | Whether to check deviation for specific object types (car, truck, etc.). |
3132
| `debug_marker.*` | bool | Debugging parameters for marker visualization (history path, predicted path, etc.). |
3233

evaluator/perception_online_evaluator/include/perception_online_evaluator/parameters.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct Parameters
4848
std::vector<Metric> metrics;
4949
size_t smoothing_window_size{0};
5050
std::vector<double> prediction_time_horizons;
51+
double stopped_velocity_threshold{0.0};
5152
DebugMarkerParameter debug_marker_parameters;
5253
// parameters depend on object class
5354
std::unordered_map<uint8_t, ObjectParameter> object_parameters;

evaluator/perception_online_evaluator/param/perception_online_evaluator.defaults.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
prediction_time_horizons: [1.0, 2.0, 3.0, 5.0]
1313

14+
stopped_velocity_threshold: 0.3
15+
1416
target_object:
1517
car:
1618
check_deviation: true

evaluator/perception_online_evaluator/src/metrics_calculator.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ std::optional<MetricStatMap> MetricsCalculator::calculate(const Metric & metric)
4040
const auto class_objects_map = separateObjectsByClass(target_stamp_objects);
4141

4242
// filter stopped objects
43-
constexpr double stopped_velocity_threshold = 0.1;
4443
const auto stopped_objects =
45-
filterObjectsByVelocity(target_stamp_objects, stopped_velocity_threshold);
44+
filterObjectsByVelocity(target_stamp_objects, parameters_->stopped_velocity_threshold);
4645
const auto class_stopped_objects_map = separateObjectsByClass(stopped_objects);
4746

4847
switch (metric) {
@@ -392,7 +391,6 @@ MetricStatMap MetricsCalculator::calcYawRateMetrics(const ClassObjectsMap & clas
392391

393392
void MetricsCalculator::setPredictedObjects(const PredictedObjects & objects)
394393
{
395-
// using TimeStamp = builtin_interfaces::msg::Time;
396394
current_stamp_ = objects.header.stamp;
397395

398396
// store objects to check deviation

evaluator/perception_online_evaluator/src/perception_online_evaluator_node.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ void PerceptionOnlineEvaluatorNode::initParameter()
280280
p->smoothing_window_size = getOrDeclareParameter<int>(*this, "smoothing_window_size");
281281
p->prediction_time_horizons =
282282
getOrDeclareParameter<std::vector<double>>(*this, "prediction_time_horizons");
283+
p->stopped_velocity_threshold =
284+
getOrDeclareParameter<double>(*this, "stopped_velocity_threshold");
283285

284286
// set metrics
285287
const auto selected_metrics =

0 commit comments

Comments
 (0)