RobotWebTools / roslibjs

The Standard ROS JavaScript Library
https://robotwebtools.github.io/roslibjs
Other
660 stars 373 forks source link

Heartbeat for rosbridge #563

Closed ravijo closed 1 year ago

ravijo commented 1 year ago

This question has been asked previously in ROS Answers.

We have seen that the web client stays quiet even if the connection with the rosbridge server breaks (such as WiFi disconnects). Therefore, it is essential to have a built-in feature, like a heartbeat topic, that a rosbridge client can use to detect the connection status.

MatthijsBurgh commented 1 year ago

The ROS class emits a close event when the connection get disconnected. You can use that. I use that in my auto-ros wrapper, https://github.com/tue-robotics/auto-ros

ravijo commented 1 year ago

Oh yeah. I completely forgot about the close event. It is there in my web app but just doing a console.log(), nothing else. Thanks for sharing the auto-ros wrapper.