ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Unique value in multiple nodes

asked 2016-10-18 18:01:30 -0500

maxb gravatar image


I'm running multiple nodes (started by one launch-file) and a few of them are logging data at the same time independently. In the end I'd like to evaluate these different log-files in another program (lets say MATLAB). The issue is the following: If I'm creating 3 different logfiles in 3 different nodes I don't want to enter 3 different filenames in MATLAB later. So here the question: Can I somehow find a value that is unique for every simulation (every start of the launch-file) and that every node has access to? I was thinking about constant values like the start time of the core and then put this value into each logfile-name, e.g.

log1-10-18-09-30-30.txt # created by node 1

log2-10-18-09-30-30.txt # created by node 2

log3-10-18-09-30-30.txt # created by node 3

with October 18th, 09:30:30 the start time of the core. It doesn't necessarily need to be the start time though, it just needs to be the same value for every node. (Nodes are written in Python and Julia).

Thank you for any advice or ideas!

Best, Max

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-10-19 01:32:57 -0500

mgruhler gravatar image

ROS loads a parameter /run_id on the parameter server which is unique for every start of the roscore. You could read this from the parameter server in your nodes and add that. It is not a time, and looks something like this 8e6217fa-95c5-11e6-a04a-<MAC>, but will probably suit your needs, if you are not requireing the actual time.

edit flag offensive delete link more


Cool thank you, just what I was looking for!!

maxb gravatar image maxb  ( 2016-10-19 09:52:29 -0500 )edit

Question Tools



Asked: 2016-10-18 18:01:30 -0500

Seen: 229 times

Last updated: Oct 19 '16