From d0acc53eaae821f1539072c4312a58b7ec7117cf Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 19 Dec 2023 15:34:08 -0500 Subject: [PATCH 1/2] Fix serialization of non string members for detected object json --- .../CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp b/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp index 9ad219e1f..9ecf81857 100755 --- a/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp +++ b/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp @@ -706,8 +706,16 @@ void CARMAStreetsPlugin::SubscribeSDSMKafkaTopic(){ void CARMAStreetsPlugin::HandleSimulatedSensorDetectedMessage(simulation::SensorDetectedObject &msg, routeable_message &routeableMsg) { + // TODO: This is a temporary fix for tmx message container property tree + // serializing all attributes as strings. This issue needs to be fixed but + // 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() < Date: Tue, 19 Dec 2023 17:08:08 -0500 Subject: [PATCH 2/2] Update regex for negative values --- src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp b/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp index 9ecf81857..eb1ba1597 100755 --- a/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp +++ b/src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp @@ -712,7 +712,7 @@ void CARMAStreetsPlugin::HandleSimulatedSensorDetectedMessage(simulation::Sensor // 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() <