Skip to content

Commit

Permalink
fixup! feat(avoidance): suppress unnecessary avoidance path
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshi-ota committed Nov 18, 2023
1 parent 2d476e8 commit 94b6aff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions planning/behavior_path_planner/src/utils/avoidance/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ bool isSatisfiedWithCommonCondition(
return true;
}

bool isSatisfiedWithNonVehicleCodition(
bool isSatisfiedWithNonVehicleCondition(

Check warning on line 556 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/utils/avoidance/utils.cpp#L556

Added line #L556 was not covered by tests
ObjectData & object, [[maybe_unused]] const AvoidancePlanningData & data,
const std::shared_ptr<const PlannerData> & planner_data,
[[maybe_unused]] const std::shared_ptr<AvoidanceParameters> & parameters)
Expand All @@ -567,7 +567,7 @@ bool isSatisfiedWithNonVehicleCodition(
return true;
}

bool isSatisfiedWithVehicleCodition(
bool isSatisfiedWithVehicleCondition(

Check warning on line 570 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/utils/avoidance/utils.cpp#L570

Added line #L570 was not covered by tests
ObjectData & object, const AvoidancePlanningData & data,
const std::shared_ptr<const PlannerData> & planner_data,
const std::shared_ptr<AvoidanceParameters> & parameters)
Expand Down Expand Up @@ -1406,12 +1406,12 @@ void filterTargetObjects(
}

if (filtering_utils::isVehicleTypeObject(o)) {

Check notice on line 1408 in planning/behavior_path_planner/src/utils/avoidance/utils.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ No longer an issue: Complex Conditional

filterTargetObjects no longer has a complex conditional. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
if (filtering_utils::isSatisfiedWithVehicleCodition(o, data, planner_data, parameters)) {
if (!filtering_utils::isSatisfiedWithVehicleCondition(o, data, planner_data, parameters)) {
data.other_objects.push_back(o);
continue;
}
} else {
if (filtering_utils::isSatisfiedWithNonVehicleCodition(o, data, planner_data, parameters)) {
if (!filtering_utils::isSatisfiedWithNonVehicleCondition(o, data, planner_data, parameters)) {
data.other_objects.push_back(o);
continue;
}
Expand Down

0 comments on commit 94b6aff

Please sign in to comment.