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

feat(crosswalk): add pass marker #9952

Merged
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 @@ -78,6 +78,7 @@ struct DebugData

std::vector<geometry_msgs::msg::Pose> stop_poses;
std::vector<geometry_msgs::msg::Pose> slow_poses;
std::vector<geometry_msgs::msg::Pose> pass_poses;
std::vector<geometry_msgs::msg::Point> stop_factor_points;
std::vector<geometry_msgs::msg::Point> crosswalk_polygon;
std::vector<std::vector<geometry_msgs::msg::Point>> ego_polygons;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ autoware::motion_utils::VirtualWalls CrosswalkModule::createVirtualWalls()
wall.pose = calcOffsetPose(p, debug_data_.base_link2front, 0.0, 0.0);
virtual_walls.push_back(wall);
}
wall.style = autoware::motion_utils::VirtualWallType::pass;
wall.text += debug_data_.virtual_wall_suffix;
for (const auto & p : debug_data_.pass_poses) {
wall.pose = calcOffsetPose(p, debug_data_.base_link2front, 0.0, 0.0);
virtual_walls.push_back(wall);
}

return virtual_walls;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020-2023 Tier IV, Inc.

Check notice on line 1 in planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Lines of Code in a Single File

The lines of code increases from 1089 to 1090, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -476,12 +476,13 @@
return strong_brk_dist_opt ? strong_brk_dist_opt.value() : 0.0;
}();
if (selected_stop.dist < strong_brk_dist - p.overrun_threshold_length_for_no_stop_decision) {
RCLCPP_INFO(
logger_,
RCLCPP_INFO_THROTTLE(

Check warning on line 479 in planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp#L479

Added line #L479 was not covered by tests
logger_, *clock_, 1000,
"Abandon to stop. "
"Can not stop against the nearest pedestrian with a specified deceleration. "
"dist to stop: %f, braking distance: %f",
selected_stop.dist, strong_brk_dist);
debug_data_.pass_poses.push_back(selected_stop.pose);

Check warning on line 485 in planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

CrosswalkModule::calcStopPose already has high cyclomatic complexity, and now it increases in Lines of Code from 92 to 93. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 485 in planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp#L485

Added line #L485 was not covered by tests
return std::nullopt;
}

Expand Down
Loading