Add random UUID to each object
This commit is contained in:
parent
7796833021
commit
0adfc88e14
|
@ -20,6 +20,7 @@
|
||||||
#include "tf2/LinearMath/Quaternion.h"
|
#include "tf2/LinearMath/Quaternion.h"
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
namespace gn = vanetza::geonet;
|
namespace gn = vanetza::geonet;
|
||||||
|
|
||||||
|
@ -151,6 +152,10 @@ namespace v2x
|
||||||
object.shape = shape;
|
object.shape = shape;
|
||||||
object.kinematics = kinematics;
|
object.kinematics = kinematics;
|
||||||
|
|
||||||
|
std::mt19937 gen(std::random_device{}());
|
||||||
|
std::independent_bits_engine<std::mt19937, 8, uint8_t> 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);
|
output_dynamic_object_msg.objects.push_back(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue