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(predicted_path_checker): check if trajectory size #6730

Merged
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 @@ -537,6 +537,10 @@
const Pose & ego_pose, const TrajectoryPoints & traj, const double dist_threshold,
const bool use_prediction, PredictedObjects & filtered_objects)
{
if (traj.size() < 2) {
RCLCPP_ERROR(rclcpp::get_logger("predicted_path_checker"), "Trajectory size is less than 2.");
return;
}

Check warning on line 543 in control/predicted_path_checker/src/predicted_path_checker_node/predicted_path_checker_node.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

PredictedPathCheckerNode::filterObstacles increases in cyclomatic complexity from 10 to 11, threshold = 9. 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.
filtered_objects.header.frame_id = object_ptr_.get()->header.frame_id;
filtered_objects.header.stamp = this->now();

Expand Down
Loading