0
$\begingroup$

Rosanswers logo

Im running ROS on a AUV that connects wirelessly to a pilot computer. The AUV runs roscore and the pilot computer runs a few nodes to send commands and display its state. When the AUV loses connection everything stops working. If I kill all nodes on the pilot computer before the connection is lost it works fine so Im guessing this is because it gets stuck trying to publish to the pilot computer.

Is there a way to gracefully handle a lost connection between nodes using rospy?


Originally posted by gudjon on ROS Answers with karma: 111 on 2014-05-09

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

By default, rospy publishers are blocking, and a blocking publish call won't return until the underlying TCP socket succeeds or times out. You can change this by specifying the queue size to the rospy publisher.

The original bug report for this is ros_comm #169 and the fix is released into Hydro and later releases.


Originally posted by ahendrix with karma: 47576 on 2014-05-09

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gudjon on 2014-05-14:
Thanks, adding queue_size=1 seams to fix my problem in most cases. I'm still having problems with one node that uses action lib but I think I can work around that.

Comment by ahendrix on 2014-05-14:
If the rospy implementation of actionlib doesn't support setting the queue size yet, you should probably open a bug letting them know about it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.