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
service::waitForService stuck in ros::Duration::sleep when use_sim_time true without /clock publisher, because using ros::Duration::sleep instead of ros::WallDuration::sleep
#1492
Closed
alrros opened this issue
Aug 22, 2018
· 3 comments
The function service::waitForService in file libros/service.cpp
uses ros::Duration::sleep instead of ros::WallDuration::sleep,
which leads to the side effect of beeing stuck in ros::Duration::sleep
under the following conditions:
use_sim_time is set as ros parameter
no simulated time publisher is active (no /clock publisher)
the service provider is not yet available
This case is significantly critical, when:
using a nodelet as /clock publisher
starting nodelet manager and nodelet loader in 1 roslaunch
--> in 99/100 cases everything is fine
--> in 1/100 cases the nodelet loader gets stuck in service::waitForService -> ros::Duration::sleep
Although nodelet is used as an example, the main problem is the usage of ros::Duration::sleep at service client initialization instead of ros::WallDuration::sleep.
Quick Reproduction:
The problem can be quickly reproduced the following way by using the service "load_nodelet" of the nodelet manager as an example:
case A) everything is fine
first: terminal 1: roscore
then: terminal 2: rosparam set use_sim_time "true"
The function service::waitForService in file libros/service.cpp
uses ros::Duration::sleep instead of ros::WallDuration::sleep,
which leads to the side effect of beeing stuck in ros::Duration::sleep
under the following conditions:
This case is significantly critical, when:
--> in 99/100 cases everything is fine
--> in 1/100 cases the nodelet loader gets stuck in service::waitForService -> ros::Duration::sleep
Although nodelet is used as an example, the main problem is the usage of ros::Duration::sleep at service client initialization instead of ros::WallDuration::sleep.
Quick Reproduction:
The problem can be quickly reproduced the following way by using the service "load_nodelet" of the nodelet manager as an example:
case A) everything is fine
==> nodelet is loaded
case B) stuck, no nodelet loaded
==> no nodelet loaded, empty list
(note: no /clock publisher is active, but ros::Duration::sleep is never executed in case A)
function
in file
uses
instead of
under the following conditions
causing critical side effect:
The text was updated successfully, but these errors were encountered: