From afb99539898beb287bd24bb41354e9027e74c07e Mon Sep 17 00:00:00 2001 From: Shin-kyoto Date: Thu, 30 May 2024 20:38:13 +0900 Subject: [PATCH] feat(traffic_light_fine_detector): add test case Signed-off-by: Shin-kyoto --- .../traffic_light_fine_detector/test/test_nodelet.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/perception/traffic_light_fine_detector/test/test_nodelet.cpp b/perception/traffic_light_fine_detector/test/test_nodelet.cpp index 99b90f8b74881..7d50c1c4068ee 100644 --- a/perception/traffic_light_fine_detector/test/test_nodelet.cpp +++ b/perception/traffic_light_fine_detector/test/test_nodelet.cpp @@ -40,3 +40,11 @@ tensorrt_yolox::Object createYoloxBbox( bbox.type = type; return bbox; } + +TEST(CalWeightedIouTest, NoOverlap) +{ + const sensor_msgs::msg::RegionOfInterest map_based_bbox = createMapBasedBbox(0, 0, 10, 10); + const tensorrt_yolox::Object yolox_bbox = createYoloxBbox(20, 20, 10, 10, 0.9f, 0); + + EXPECT_FLOAT_EQ(traffic_light::calWeightedIou(map_based_bbox, yolox_bbox), 0.0f); +}