PepperlFuchs / pf_lidar_ros_driver

ROS driver for Pepperl+Fuchs R2000 and R2300 laser scanners
https://www.pepperl-fuchs.com/global/en/23097.htm
Apache License 2.0
39 stars 38 forks source link

Impossible to terminate ros_main node cleanly. #105

Closed ValerioMagnago closed 1 year ago

ValerioMagnago commented 1 year ago

It is not possible to kill the node cleanly. Calling rosnode kill brings the driver into a deadlock situation and it is not possible to kill cleanly the node.

image

hsd-dev commented 1 year ago

Yes this is a known issue, but I have ignored it so far since it was not a blocking factor for the current users. Have you been able to debug the problem?

ValerioMagnago commented 1 year ago

No, I didn't analyze the problem, but looking at the code this line here seems suspicious.

net_cv_->wait(net_lock, [&net_fail] { return net_fail; });

If my understanding is correct, here we just wait for a network failure but we do not react to a node termination.

Side note. I see you are using a ros::AsyncSpinner and you set the number of threads as the number of processor core (https://docs.ros.org/en/noetic/api/roscpp/html/classros_1_1AsyncSpinner.html#aa5b9b685b7eebebf18ed42697e209897) why?