From 28ffe11fd7adea462751d94e63e7ab97d7825143 Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Tue, 27 Aug 2024 14:21:01 -0400 Subject: [PATCH 1/3] fix --- src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp | 2 +- src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.cpp | 2 +- src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp b/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp index 9a23f0324..ab5d3d71f 100755 --- a/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp +++ b/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp @@ -711,7 +711,7 @@ void CARMAStreetsPlugin::HandleSimulatedSensorDetectedMessage(SensorDetectedObje // is currently out of scope. TMX Messages should be correctly serialize to // and from json. This temporary fix simply using regex to look for numeric, // null, and bool values and removes the quotations around them. - PLOG(logDEBUG) << "Produce sensor detected message in JSON format: " << msg.to_string() <(detection.timestamp*1000)); // convert decimal seconds to int milliseconds. detectedObject.set_velocity(headingSpeedToVelocity(detection.heading, detection.speed)); detectedObject.set_type(detectionClassificationToSensorDetectedObjectType(detection.cl)); diff --git a/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h b/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h index 9140b0252..71bb62ac8 100644 --- a/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h +++ b/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h @@ -94,6 +94,7 @@ namespace MUSTSensorDriverPlugin { DetectionSize size = DetectionSize::NA; // Confidence in type double confidence = 0; + int PERCENTAGE_TO_DECIMAL = 100.0; // Unique ID unsigned int trackID = 0; // Timestamp in seconds From 49b95aeeaa28b92728f37b25fbf55da69cad47c4 Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Tue, 27 Aug 2024 14:33:03 -0400 Subject: [PATCH 2/3] update --- src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.cpp | 2 +- src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.cpp b/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.cpp index 906c24089..0256bb93a 100644 --- a/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.cpp +++ b/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.cpp @@ -34,7 +34,7 @@ namespace MUSTSensorDriverPlugin { detectedObject.set_objectId(detection.trackID); tmx::messages::Position pos(detection.position_x, detection.position_y, 0); detectedObject.set_position(pos); - detectedObject.set_confidence(detection.confidence/PERCENTAGE_TO_DECIMAL); + detectedObject.set_confidence(detection.confidence/100.0); detectedObject.set_timestamp(static_cast(detection.timestamp*1000)); // convert decimal seconds to int milliseconds. detectedObject.set_velocity(headingSpeedToVelocity(detection.heading, detection.speed)); detectedObject.set_type(detectionClassificationToSensorDetectedObjectType(detection.cl)); diff --git a/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h b/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h index 71bb62ac8..9140b0252 100644 --- a/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h +++ b/src/v2i-hub/MUSTSensorDriverPlugin/src/MUSTSensorDetection.h @@ -94,7 +94,6 @@ namespace MUSTSensorDriverPlugin { DetectionSize size = DetectionSize::NA; // Confidence in type double confidence = 0; - int PERCENTAGE_TO_DECIMAL = 100.0; // Unique ID unsigned int trackID = 0; // Timestamp in seconds From 8566c2c39f9b71b41c5164327b4afd6f60ea3298 Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Wed, 28 Aug 2024 09:32:32 -0400 Subject: [PATCH 3/3] fix test --- .../MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp b/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp index 8a62e1c99..d065d31a3 100644 --- a/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp +++ b/src/v2i-hub/MUSTSensorDriverPlugin/test/TestMUSTSensorDetection.cpp @@ -66,7 +66,7 @@ TEST(TestMUSTSensorDetection, mustDetectionToSensorDetectedObject ) { auto sensorDetectedObject = mustDetectionToSensorDetectedObject(detection, "MUSTSensor1", "PROJ String"); EXPECT_EQ(detection.trackID, sensorDetectedObject.get_objectId()); - EXPECT_DOUBLE_EQ(detection.confidence, sensorDetectedObject.get_confidence()); + EXPECT_DOUBLE_EQ(detection.confidence/100.0, sensorDetectedObject.get_confidence()); EXPECT_DOUBLE_EQ(detection.position_x, sensorDetectedObject.get_position().x); EXPECT_DOUBLE_EQ(detection.position_y, sensorDetectedObject.get_position().y); EXPECT_NEAR(4.33, sensorDetectedObject.get_velocity().y, 0.001);