From 9e0b3fd9a9a080e6b98213070fd99038583c1720 Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Wed, 21 Aug 2024 20:54:50 +0000 Subject: [PATCH 1/3] additional class values --- .../MUSTSensorDriverPlugin/src/MUSTSensorDetection.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h b/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h index 313204811..cd2dfcd6f 100644 --- a/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h +++ b/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h @@ -16,6 +16,9 @@ namespace MUSTSensorDriverPlugin { enum class DetectionClassification { SEDAN, TRUCK, + BUS, + PICKUP_TRUCK, + PEDESTRIAN, VAN, NA }; @@ -46,7 +49,10 @@ namespace MUSTSensorDriverPlugin { const static std::unordered_map stringToDetectionClassificationMap = { {"sedan", DetectionClassification::SEDAN}, {"truck", DetectionClassification::TRUCK}, - {"van", DetectionClassification::VAN} + {"van", DetectionClassification::VAN}, + {"bus", DetectionClassification::BUS}, + {"pickup truck", DetectionClassification::PICKUP_TRUCK}, + {"pedestrian", DetectionClassification::PEDESTRIAN} }; /** From 467dc7057b3a4f3d32d7c7c1ec454e79b7879ebd Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Wed, 21 Aug 2024 20:58:58 +0000 Subject: [PATCH 2/3] update unit test --- .../MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp b/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp index a50783d3a..375c97c24 100644 --- a/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp +++ b/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp @@ -18,6 +18,9 @@ TEST(TestMUSTSensorDetection, fromStringToDetectionClassification) EXPECT_EQ(DetectionClassification::SEDAN, fromStringToDetectionClassification("sedan")); EXPECT_EQ(DetectionClassification::VAN, fromStringToDetectionClassification("van")); EXPECT_EQ(DetectionClassification::TRUCK, fromStringToDetectionClassification("truck")); + EXPECT_EQ(DetectionClassification::TRUCK, fromStringToDetectionClassification("bus")); + EXPECT_EQ(DetectionClassification::TRUCK, fromStringToDetectionClassification("pickup truck")); + EXPECT_EQ(DetectionClassification::TRUCK, fromStringToDetectionClassification("pedestrain")); EXPECT_EQ(DetectionClassification::NA, fromStringToDetectionClassification("not_a_classification")); } @@ -78,6 +81,9 @@ TEST(TestMUSTSensorDetection, detectionClassificationToSensorDetectedObjectType EXPECT_STRCASEEQ("SEDAN", detectionClassificationToSensorDetectedObjectType(DetectionClassification::SEDAN).c_str()); EXPECT_STRCASEEQ("VAN", detectionClassificationToSensorDetectedObjectType(DetectionClassification::VAN).c_str()); EXPECT_STRCASEEQ("TRUCK", detectionClassificationToSensorDetectedObjectType(DetectionClassification::TRUCK).c_str()); + EXPECT_STRCASEEQ("BUS", detectionClassificationToSensorDetectedObjectType(DetectionClassification::BUS).c_str()); + EXPECT_STRCASEEQ("PICKUP TRUCK", detectionClassificationToSensorDetectedObjectType(DetectionClassification::PICKUP_TRUCK).c_str()); + EXPECT_STRCASEEQ("PEDESTRIAN", detectionClassificationToSensorDetectedObjectType(DetectionClassification::PEDESTRIAN).c_str()); EXPECT_THROW(detectionClassificationToSensorDetectedObjectType(DetectionClassification::NA).c_str(), std::runtime_error); } From 4bf87efe74011c26515103d97cf720acb3088717 Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Wed, 21 Aug 2024 21:03:15 +0000 Subject: [PATCH 3/3] update unit test --- .../MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp b/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp index 375c97c24..99595cc02 100644 --- a/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp +++ b/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp @@ -18,9 +18,9 @@ TEST(TestMUSTSensorDetection, fromStringToDetectionClassification) EXPECT_EQ(DetectionClassification::SEDAN, fromStringToDetectionClassification("sedan")); EXPECT_EQ(DetectionClassification::VAN, fromStringToDetectionClassification("van")); EXPECT_EQ(DetectionClassification::TRUCK, fromStringToDetectionClassification("truck")); - EXPECT_EQ(DetectionClassification::TRUCK, fromStringToDetectionClassification("bus")); - EXPECT_EQ(DetectionClassification::TRUCK, fromStringToDetectionClassification("pickup truck")); - EXPECT_EQ(DetectionClassification::TRUCK, fromStringToDetectionClassification("pedestrain")); + EXPECT_EQ(DetectionClassification::BUS, fromStringToDetectionClassification("bus")); + EXPECT_EQ(DetectionClassification::PICKUP_TRUCK, fromStringToDetectionClassification("pickup truck")); + EXPECT_EQ(DetectionClassification::PEDESTRIAN, fromStringToDetectionClassification("pedestrian")); EXPECT_EQ(DetectionClassification::NA, fromStringToDetectionClassification("not_a_classification")); }