From 63662a5e31e19dfe0e5f27b86652ce0555c2f542 Mon Sep 17 00:00:00 2001 From: CY Chen Date: Thu, 18 Apr 2024 19:16:53 -0700 Subject: [PATCH 1/2] Improve randomization seed for generating node's random namespace Signed-off-by: CY Chen --- isaac_ros_nitros/src/nitros_node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isaac_ros_nitros/src/nitros_node.cpp b/isaac_ros_nitros/src/nitros_node.cpp index f28ee44..540142b 100644 --- a/isaac_ros_nitros/src/nitros_node.cpp +++ b/isaac_ros_nitros/src/nitros_node.cpp @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES -// Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ const std::vector PRESET_EXTENSION_SPEC_NAMES = { namespace { // Generate a random string of the given length -unsigned int seed = time(NULL); +unsigned int seed = time(NULL) ^ getpid(); std::string GenerateRandomString(const size_t length) { std::string output_string; From 45f132d02c339e492245410182014b72a1cc5504 Mon Sep 17 00:00:00 2001 From: CY Chen Date: Thu, 18 Apr 2024 21:22:49 -0700 Subject: [PATCH 2/2] Add header for getpid() Signed-off-by: CY Chen --- isaac_ros_nitros/src/nitros_node.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/isaac_ros_nitros/src/nitros_node.cpp b/isaac_ros_nitros/src/nitros_node.cpp index 540142b..c73621a 100644 --- a/isaac_ros_nitros/src/nitros_node.cpp +++ b/isaac_ros_nitros/src/nitros_node.cpp @@ -15,6 +15,7 @@ // // SPDX-License-Identifier: Apache-2.0 +#include #include #include