Skip to content

Commit

Permalink
Update docstring and small code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime CLEMENT <[email protected]>
  • Loading branch information
maxime-clem committed Dec 25, 2023
1 parent d0490c4 commit 84fee4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void apply_arc_length_range_smoothing(
Expansion & expansion, const std::vector<Point> & bound, const double arc_length_range,
const Side side);

/// @brief calculate mappings between path poses and the given drivable area bound
/// @brief calculate minimum lane widths and mappings between path and and drivable area bounds
/// @param [in] path_poses path poses
/// @param [in] left_bound left drivable area bound
/// @param [in] right_bound right drivable area bound
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ std::vector<double> calculate_maximum_distance(
const auto segment_vector = segment_ls.second - segment_ls.first;
const auto is_point_on_correct_side = [&](const Point2d & p) {
const auto point_vector = p - segment_ls.first;

Check warning on line 224 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp#L223-L224

Added lines #L223 - L224 were not covered by tests
return (segment_vector.x() * point_vector.y() - segment_vector.y() * point_vector.x()) *
(side == LEFT ? -1.0 : 1.0) <=
0.0;
const auto cross_product =
(segment_vector.x() * point_vector.y() - segment_vector.y() * point_vector.x());
return cross_product * (side == LEFT ? -1.0 : 1.0) <= 0.0;
};
const auto is_on_correct_side = [&](const Segment2d & segment) {

Check warning on line 229 in planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp#L229

Added line #L229 was not covered by tests
return is_point_on_correct_side(segment.first) || is_point_on_correct_side(segment.second);
Expand Down

0 comments on commit 84fee4e

Please sign in to comment.