Skip to content

Commit

Permalink
Update regex for negative values
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Dec 19, 2023
1 parent d0acc53 commit 7db8ac5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() <<std::endl;
boost::regex exp("\"(null|true|false|[0-9]+(\\.[0-9]+)?)\"");
boost::regex exp("\"(null|true|false|-?[0-9]+(\\.[0-9]+)?)\"");
std::stringstream ss;
std::string rv = boost::regex_replace(msg.to_string(), exp, "$1");
produce_kafka_msg( rv, _transmitSimSensorDetectedObjTopic);
Expand Down

0 comments on commit 7db8ac5

Please sign in to comment.