Rosanswers logo


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

Originally posted by maxb on ROS Answers with karma: 13 on 2016-10-18

Post score: 0


1 Answer 1


Rosanswers logo

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.

Originally posted by mgruhler with karma: 12390 on 2016-10-19

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by maxb on 2016-10-19:
Cool thank you, just what I was looking for!!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.