use_sim_time only for some of the running nodes
Is there some way to enable use_sim_time
only for dedicated nodes?
I have a scenario in which a node should use the simulated time published on /clock
while at the same time other nodes are running which should use the wall time.
Since /use_sim_time
is a global parameter, simply setting it to true would lead to all nodes using the simulated time. I think it would work to first start the wall-time nodes, then set the parameter and after that start the sim-time node, but I would prefer a more robust method, if there is any.
Can you explain why you feel you need this, just to avoid an xy-problem? Perhaps board members can then assess whether it makes sense to do this.
There is a reason
use_sim_time
is 'a global parameter'.I need a node to process a bagfile (using the clock from the bagfile) while other nodes are running normally (i.e. using the wall-time) on the same machine.
Ok, so why do the other nodes need to use wall-time?
The other nodes do not subscribe to anything published by the bagfile. I have a running system and just a single node (which is completely decoupled from the remaining system) needs to do some processing of a bagfile. Unfortunately it has to run together on the same machine.
An idea just came to my mind, maybe I can solve it by running two parallel roscores.
Are the other nodes not using data from the bag file?
It may be better to use the C++ bag API to process the bag file instead of publishing those messages and having a node that subscribes to them.