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(autoware_behavior_path_side_shift_module): fix unusedFunction #8655

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 @@ -29,16 +29,8 @@ using tier4_planning_msgs::msg::PathWithLaneId;

void setOrientation(PathWithLaneId * path);

bool getStartAvoidPose(
const PathWithLaneId & path, const double start_distance, const size_t nearest_idx,
Pose * start_avoid_pose);

bool isAlmostZero(double v);

Point transformToGrid(
const Point & pt, const double longitudinal_offset, const double lateral_offset, const double yaw,
const TransformStamped & geom_tf);

} // namespace autoware::behavior_path_planner

#endif // AUTOWARE__BEHAVIOR_PATH_SIDE_SHIFT_MODULE__UTILS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -53,49 +53,9 @@
}
}

bool getStartAvoidPose(
const PathWithLaneId & path, const double start_distance, const size_t nearest_idx,
Pose * start_avoid_pose)
{
if (!start_avoid_pose) {
return false;
}
if (nearest_idx >= path.points.size()) {
return false;
}

double arclength = 0.0;
for (size_t idx = nearest_idx + 1; idx < path.points.size(); ++idx) {
const auto pt = path.points.at(idx).point;
const auto pt_prev = path.points.at(idx - 1).point;
const double dx = pt.pose.position.x - pt_prev.pose.position.x;
const double dy = pt.pose.position.y - pt_prev.pose.position.y;
arclength += std::hypot(dx, dy);

if (arclength > start_distance) {
*start_avoid_pose = pt.pose;
return true;
}
}

return false;
}

bool isAlmostZero(double v)
{
return std::fabs(v) < 1.0e-4;
}

Check notice on line 60 in planning/behavior_path_planner/autoware_behavior_path_side_shift_module/src/utils.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ No longer an issue: Excess Number of Function Arguments

transformToGrid is no longer above the threshold for number of arguments
Point transformToGrid(
const Point & pt, const double longitudinal_offset, const double lateral_offset, const double yaw,
const TransformStamped & geom_tf)
{
Point offset_pt, grid_pt;
offset_pt = pt;
offset_pt.x += longitudinal_offset * cos(yaw) - lateral_offset * sin(yaw);
offset_pt.y += longitudinal_offset * sin(yaw) + lateral_offset * cos(yaw);
tf2::doTransform(offset_pt, grid_pt, geom_tf);
return grid_pt;
}

} // namespace autoware::behavior_path_planner
Loading