Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(behavior_path_planner_common): swap boolean for filterObjectsByVelocity #9036

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,7 @@
const auto & target_object_types = params->object_types_to_check;

PredictedObjects filtered_objects = utils::path_safety_checker::filterObjectsByVelocity(
*objects, ignore_object_velocity_threshold, false);
*objects, ignore_object_velocity_threshold, true);

Check warning on line 2165 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp#L2165

Added line #L2165 was not covered by tests

utils::path_safety_checker::filterObjectsByClass(filtered_objects, target_object_types);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ PredictedObjects filterObjects(
*/
PredictedObjects filterObjectsByVelocity(
const PredictedObjects & objects, const double velocity_threshold,
const bool remove_above_threshold = true);
const bool remove_above_threshold = false);

/**
* @brief Helper function to filter objects based on their velocity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
const ObjectTypesToCheck & target_object_types = params->object_types_to_check;

PredictedObjects filtered_objects =
filterObjectsByVelocity(*objects, ignore_object_velocity_threshold, false);
filterObjectsByVelocity(*objects, ignore_object_velocity_threshold, true);

Check warning on line 121 in planning/behavior_path_planner/autoware_behavior_path_planner_common/src/utils/path_safety_checker/objects_filtering.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_planner_common/src/utils/path_safety_checker/objects_filtering.cpp#L121

Added line #L121 was not covered by tests

filterObjectsByClass(filtered_objects, target_object_types);

Expand All @@ -136,7 +136,7 @@
const PredictedObjects & objects, const double velocity_threshold,
const bool remove_above_threshold)
{
if (remove_above_threshold) {
if (!remove_above_threshold) {
return filterObjectsByVelocity(objects, -velocity_threshold, velocity_threshold);
}
return filterObjectsByVelocity(objects, velocity_threshold, std::numeric_limits<double>::max());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
utils::path_safety_checker::filterObjectsByClass(
dynamic_objects, parameters_->surround_moving_obstacles_type_to_check);
const auto filtered_objects = utils::path_safety_checker::filterObjectsByVelocity(
dynamic_objects, parameters_->th_moving_obstacle_velocity, false);
dynamic_objects, parameters_->th_moving_obstacle_velocity, true);

Check warning on line 332 in planning/behavior_path_planner/autoware_behavior_path_start_planner_module/src/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_start_planner_module/src/start_planner_module.cpp#L332

Added line #L332 was not covered by tests
if (!filtered_objects.objects.empty()) {
DEBUG_PRINT("Moving objects exist in the safety check area");
}
Expand Down
Loading