From 0adfc88e14c041a67bef189c7cb0caeda0b49bc7 Mon Sep 17 00:00:00 2001 From: yuasabe Date: Wed, 14 Sep 2022 16:14:44 +0900 Subject: [PATCH] Add random UUID to each object --- src/v2x_node.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/v2x_node.cpp b/src/v2x_node.cpp index 416fff9..61726ea 100644 --- a/src/v2x_node.cpp +++ b/src/v2x_node.cpp @@ -20,6 +20,7 @@ #include "tf2/LinearMath/Quaternion.h" #include #include +#include namespace gn = vanetza::geonet; @@ -151,6 +152,10 @@ namespace v2x object.shape = shape; object.kinematics = kinematics; + std::mt19937 gen(std::random_device{}()); + std::independent_bits_engine bit_eng(gen); + std::generate(object.object_id.uuid.begin(), object.object_id.uuid.end(), bit_eng); + output_dynamic_object_msg.objects.push_back(object); }