You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Node unable to avoid using sim time if /clock published #515
Even if a node has its use_sim_time parameter set to false, if a message is received by the TimeSource on the /clock topic, the node's clock will start using sim time.
The presence of a publisher on the clock topic currently causes nodes with unset use_sim_time parameter value to start using sim time (see #514 if you want to discuss that), but I don't think it should happen for those that have explicitly set the parameter to false.
If others agree we can label this as a bug and then only enable ROS time upon receipt of /clock msg if the parameter has not explicitly been set. That would keep the rest of the existing behaviour the same (again, if you want to discuss the behaviour on unset use_sim_time parameter, see #514).
In my opinion, it should definitely be opt-in (presence of a publisher on /clock is not sufficient), though maybe a one time warning is appropriate if use_sim_time is unset but there is a publisher (it might be an indication that there is a configuration issue). Explicitly setting use_sim_time to False could disable the warning.
Is a /clock subscription necessary when use_sim_time is false? Not having it would prevent a warning like @wjwwood described. It also would add a delay if the subscription had to be created later when use_sim_time is dynamically enabled, but I'm not sure if that's a problem.
The behavior in ROS1 is to not even subscribe unless the parameter is set. It's actually required that the parameteter is set before startup as the subscription is only created during the startup phase of a ROS1 node. I implemented this off of memory from the first implementation of ROS1 time but that evolved since that generation. As I mentioned in #514 we might want to take advantage of the parameter callbacks and support switching based on the parameter instead of requiring it at startup. Code can be robust to the change in time by using the TimeJump callbacks.
#559 made it so time source's use of sim time only depends on the use_sim_time parameter, not the presence of a clock publisher. This test was added to check that sim time doesn't activate even if a clock publisher is present if the use_sim_time parameter is set to false.
Activity
wjwwood commentedon Jul 17, 2018
In my opinion, it should definitely be opt-in (presence of a publisher on
/clockis not sufficient), though maybe a one time warning is appropriate ifuse_sim_timeis unset but there is a publisher (it might be an indication that there is a configuration issue). Explicitly settinguse_sim_timeto False could disable the warning.sloretz commentedon Jul 17, 2018
+1 to opt-in
Is a
/clocksubscription necessary whenuse_sim_timeisfalse? Not having it would prevent a warning like @wjwwood described. It also would add a delay if the subscription had to be created later whenuse_sim_timeis dynamically enabled, but I'm not sure if that's a problem.tfoote commentedon Jul 25, 2018
The behavior in ROS1 is to not even subscribe unless the parameter is set. It's actually required that the parameteter is set before startup as the subscription is only created during the startup phase of a ROS1 node. I implemented this off of memory from the first implementation of ROS1 time but that evolved since that generation. As I mentioned in #514 we might want to take advantage of the parameter callbacks and support switching based on the parameter instead of requiring it at startup. Code can be robust to the change in time by using the TimeJump callbacks.
dhood commentedon Sep 25, 2018
#559 made it so time source's use of sim time only depends on the use_sim_time parameter, not the presence of a clock publisher. This test was added to check that sim time doesn't activate even if a clock publisher is present if the
use_sim_timeparameter is set to false.Switch to one Participant per Context (ros2#515)