ros-industrial / ros_canopen

CANopen driver framework for ROS (http://wiki.ros.org/ros_canopen)
GNU Lesser General Public License v3.0
328 stars 267 forks source link

Added can device recovery code #469

Closed akashmod closed 1 year ago

akashmod commented 1 year ago

This is to solve issue 468. A ros timer is started to check the driver state after every specified duration and to reinitialize the driver for the node if the driver has recovered.

BenArtes commented 1 year ago

Summary notes for any reviewers: This covers similar ground as PR #249 (5 years old and waiting for changes) and #310 (4 years old and VERY minimal).

I think whatever happens to the socketcan_bridge auto-recovery code, the ThreadedSocketCANInterface should be merged as a (potentially) separate PR as it fixes a seemingly missing piece from ThreadedSocketCANInterface recovery code (as I ran into in issue #467).

BenArtes commented 1 year ago

Also, shouldn't ThreadedSocketCANInterface virtual void recover have a bool return type?

akashmod commented 1 year ago

The virtual void recover should have a bool return type yes. That needs to be corrected.

carlesu commented 1 year ago

Hello, Tank you very much!! This was giving me a big headache, because we actually have a device that has on/off using dead man button and had to restart the node in order to send new data. Been following #467 since then, this seems to solve the problem.

Is it possible to know approximately when could this be updated to noetic release?

Thank you again for the effort!