-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
In traffic_simulator::pose::isInLanelet to compare distance_to_start_lanelet_pose and distance_to_end_lanelet_pose with tolerance operator "<" is used. This can possibly lead to wrong result when tolerance is 0 and one of the measured distances is also 0, which means pose is in lanelet (start or end of it). If this is not expected behaviour operator "<=" should be used.
To Reproduce
- Switch to RJD-1197/pose_module. This branch contains needed test file
- Add this testcase to the test_pose.cpp file.
- Run the test suite.
TEST_F(PoseTest, isInLanelet_end_of_previous_lanelet)
{
const auto pose =
traffic_simulator::helper::constructCanonicalizedLaneletPose(3002163, 0.0, 0.0, hdmap_utils);
const auto end_lanelet_pose = traffic_simulator::helper::constructCanonicalizedLaneletPose(
195, hdmap_utils->getLaneletLength(195), 0.0, hdmap_utils);
const auto distance_to_end_lanelet_pose =
longitudinalDistance(pose, end_lanelet_pose, false, false, false, hdmap_utils);
ASSERT_TRUE(distance_to_end_lanelet_pose);
ASSERT_TRUE(std::abs(distance_to_end_lanelet_pose.value()) == 0.0);
EXPECT_TRUE(traffic_simulator::pose::isInLanelet(pose, 195, 0.0, hdmap_utils));
}
Expected behavior
If pose is at the start or end of lanelet function traffic_simulator::pose::isInLanelet should return true;
hakuturu583
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working