You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Function “getStopLinePolygon” does not check if “lanelet_id” represents a stopline. Any linesting can be passed and it will be transformed to “std::vector” unconditionally.
To Reproduce
Add this testcase to the test_hdmap_utils.cpp file.
Run the test suite.
In the attached example, the function “getPreviousLanelets” will return a non empty vector for lanelet:Id 34574, which is a linestring on the path, not a stop line.
TEST(HdMapUtils, getStopLinePolygon_example)
{
const auto hdmap_utils = makeHdMapUtilsSharedPointer();
const lanelet::Id id = 120635;
const auto stop_lines = hdmap_utils->getStopLineIdsOnPath(
lanelet::Ids{34408, 34633, 34579, 34780, 34675, 34744, 34690, 34759, 34576, 34570, 34564});
const lanelet::Ids actual_stop_lines{id};
const auto polygon = hdmap_utils->getStopLinePolygon(id);
const auto polygon_fake = hdmap_utils->getStopLinePolygon(34574);
EXPECT_EQ(stop_lines, actual_stop_lines);
EXPECT_TRUE(polygon.size());
EXPECT_FALSE(polygon_fake.size());
}
Solution
There should be added a check whether the passed lanelet ID is actually a stop line, or a note should be left stating that the “lanelet_id” is assumed to be a stop line, or the function should be renamed to something like “getLineStringPolygon”.
The text was updated successfully, but these errors were encountered:
Description
Function “getStopLinePolygon” does not check if “lanelet_id” represents a stopline. Any linesting can be passed and it will be transformed to “std::vector” unconditionally.
To Reproduce
Solution
There should be added a check whether the passed lanelet ID is actually a stop line, or a note should be left stating that the “lanelet_id” is assumed to be a stop line, or the function should be renamed to something like “getLineStringPolygon”.
The text was updated successfully, but these errors were encountered: