<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 March 2014 10:58, Dirk Thomas <span dir="ltr"><<a href="mailto:dthomas@osrfoundation.org" target="_blank">dthomas@osrfoundation.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We are looking for feedback from ROS users on a very specific question for rospy in Indigo.<br>
<br>
In the past rospy publishers sent the messages synchronously to each connection.<br>
That becomes a problem when one of the underlying network buffers runs full (which implies that it blocks).<br>
This commonly happens when e.g. using a connection over wlan and the connectivity is lost.<br>
The client code would then block on the publish() call for an undetermined amount of time (potentially forever).<br>
<br>
Therefore in Hydro an optional keyword argument was introduced to the rospy.Publisher constructor: queue_size=None (see [1])<br>
<br>
The default value of `None` maintains the previous behavior (synchronous behavior, no queuing).<br>
When an integer value is passed a queue with the maximum size of N is used to queue published messages which are then send to each connection from separate threads.<br>
(A size of zero means an infinite queue, which can be dangerous.)<br>
<br>
The implementation follows the existing roscpp implementation - except that in roscpp that argument is required.<br>
It is definitely not possible to make the argument in Python required as well since that would imply breaking every existing Python publisher.<br>
<br>
Therefore we have two options how to handle this in Indigo:<br>
<br>
a) The constructor could output a warning when the queue_size argument is missing in order to notify users / developers to update the code and actually provide a reasonable queue_size.<br>
   The warning would be printed using the Python warnings module and can therefore be omitted by setting an environment variable (see [2]).<br>
<br>
b) We keep the code as it is in Hydro meaning messages are by default published synchronously.<br>
   Users can use the optional keyword but are not given any indication from the code at runtime.<br>
<br>
The tutorials as well as Indigo migration guide will mention whatever option will finally be used.<br>
<br>
Which option would you prefer for Indigo?<br>
<br>
Thank you for your feedback,<br>
- Dirk<br>
<br>
<br>
[1] <a href="http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers" target="_blank">http://wiki.ros.org/rospy/<u></u>Overview/Publishers%20and%<u></u>20Subscribers</a><br>
[2] <a href="https://github.com/ros/ros_comm/pull/372" target="_blank">https://github.com/ros/ros_<u></u>comm/pull/372</a><br>
______________________________<u></u>_________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@lists.ros.org" target="_blank">ros-users@lists.ros.org</a><br>
<a href="http://lists.ros.org/mailman/listinfo/ros-users" target="_blank">http://lists.ros.org/mailman/<u></u>listinfo/ros-users</a><br>
</blockquote></div><br><br>I haven't looked into the api here, but I'm guessing from the above description that the default roscpp implementation accepts a non-zero(?) queue size and consequently is not synchronous. Is that true?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">If it is, what is the primary reason for wanting the python implementation proposed in b) to be different, i.e. synchronous by default? Is the threaded non-blocking implementation particularly expensive?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Daniel.</div><div class="gmail_extra"><div><br></div>
</div></div>