0
$\begingroup$

Rosanswers logo

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.


Originally posted by Felix Widmaier on ROS Answers with karma: 382 on 2017-10-05

Post score: 0


Original comments

Comment by gvdhoorn on 2017-10-05:
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'.

Comment by Felix Widmaier on 2017-10-05:
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.

Comment by gvdhoorn on 2017-10-05:
Ok, so why do the other nodes need to use wall-time?

Comment by Felix Widmaier on 2017-10-05:
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.

Comment by Felix Widmaier on 2017-10-05:
An idea just came to my mind, maybe I can solve it by running two parallel roscores.

Comment by jayess on 2017-10-05:
Are the other nodes not using data from the bag file?

Comment by ahendrix on 2017-10-05:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I solved it now by running two separate roscores (see e.g. this question). So the nodes using the wall time run with one core and the node using the simulated time runs with the other core.


Originally posted by Felix Widmaier with karma: 382 on 2017-10-09

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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