Skip to content

Commit

Permalink
fix: disable default argument value for include_oppsite_direction in …
Browse files Browse the repository at this point in the history
…HdMapUtils::getLeftLaneletIds/getRightLaneletIds
  • Loading branch information
HansRobo committed Dec 10, 2024
1 parent 9e4fdaf commit 2ebc41a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class HdMapUtils

auto getLeftLaneletIds(
const lanelet::Id, const traffic_simulator::RoutingGraphType,
const bool include_opposite_direction = false) const -> lanelet::Ids;
const bool include_opposite_direction) const -> lanelet::Ids;

auto getLongitudinalDistance(
const traffic_simulator_msgs::msg::LaneletPose & from_pose,
Expand Down Expand Up @@ -269,7 +269,7 @@ class HdMapUtils

auto getRightLaneletIds(
const lanelet::Id, const traffic_simulator::RoutingGraphType,
const bool include_opposite_direction = false) const -> lanelet::Ids;
const bool include_opposite_direction) const -> lanelet::Ids;

auto getRightOfWayLaneletIds(const lanelet::Ids &) const
-> std::unordered_map<lanelet::Id, lanelet::Ids>;
Expand Down
5 changes: 3 additions & 2 deletions simulation/traffic_simulator/src/hdmap_utils/hdmap_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,12 @@ auto HdMapUtils::countLaneChanges(

if (auto followings = getNextLaneletIds(previous, routing_configuration.routing_graph_type);
std::find(followings.begin(), followings.end(), current) == followings.end()) {
if (auto lefts = getLeftLaneletIds(previous, routing_configuration.routing_graph_type);
if (auto lefts =
getLeftLaneletIds(previous, routing_configuration.routing_graph_type, false);
std::find(lefts.begin(), lefts.end(), current) != lefts.end()) {
lane_changes.first++;
} else if (auto rights =
getRightLaneletIds(previous, routing_configuration.routing_graph_type);
getRightLaneletIds(previous, routing_configuration.routing_graph_type, false);
std::find(rights.begin(), rights.end(), current) != rights.end()) {
lane_changes.second++;
}
Expand Down

0 comments on commit 2ebc41a

Please sign in to comment.