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(route_handler): add preferred lane getter function #6496

Merged
merged 1 commit into from
Feb 27, 2024
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 @@ -327,6 +327,7 @@ class RouteHandler
lanelet::ConstLanelets getShoulderLanelets() const;
bool isShoulderLanelet(const lanelet::ConstLanelet & lanelet) const;
bool isRouteLanelet(const lanelet::ConstLanelet & lanelet) const;
lanelet::ConstLanelets getPreferredLanelets() const;

// for path
PathWithLaneId getCenterLinePath(
Expand Down
5 changes: 5 additions & 0 deletions planning/route_handler/src/route_handler.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2023 Tier IV, Inc.

Check notice on line 1 in planning/route_handler/src/route_handler.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 1907 to 1911, 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.

Check notice on line 1 in planning/route_handler/src/route_handler.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Number of Functions in a Single Module

The number of functions increases from 109 to 110, threshold = 75. This file contains too many functions. Beyond a certain threshold, more functions lower the code health.

Check notice on line 1 in planning/route_handler/src/route_handler.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 4.50 to 4.47, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
//
// 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 @@ -433,6 +433,11 @@
return route_lanelets_;
}

lanelet::ConstLanelets RouteHandler::getPreferredLanelets() const

Check warning on line 436 in planning/route_handler/src/route_handler.cpp

View check run for this annotation

Codecov / codecov/patch

planning/route_handler/src/route_handler.cpp#L436

Added line #L436 was not covered by tests
{
return preferred_lanelets_;

Check warning on line 438 in planning/route_handler/src/route_handler.cpp

View check run for this annotation

Codecov / codecov/patch

planning/route_handler/src/route_handler.cpp#L438

Added line #L438 was not covered by tests
}

Pose RouteHandler::getStartPose() const
{
if (!route_ptr_) {
Expand Down
Loading