Yes, code would be nice.<br>I often use Python's Queue module<br><br><div style="margin-left: 40px;"><a href="http://docs.python.org/library/queue.html">http://docs.python.org/library/queue.html</a><br></div><br>when doing this sort of thing, as well as the ROS message filters:<br>
<br><div style="margin-left: 40px;"><a href="http://www.ros.org/doc/api/message_filters/html/python/">http://www.ros.org/doc/api/message_filters/html/python/</a><br></div><br>camera_calibration uses<span style="font-family: times new roman,serif;"> a </span><span style="font-family: courier new,monospace;" class="descclassname">message_filters.</span><span style="font-family: times new roman,serif;" class="descname"><span style="font-family: courier new,monospace;">TimeSynchronizer</span> to</span><tt class="descname"> </tt>listen to left and right camera topics.<br>
<br>
<div class="gmail_quote">On Thu, Apr 15, 2010 at 9:04 AM, Blaise Gassend <span dir="ltr"><<a href="mailto:blaise@willowgarage.com">blaise@willowgarage.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Pat,<br>
<br>
You could have a look at the pr2_dashboard_aggregator. It has many<br>
inputs and a single output and needs no locking at all.<br>
<br>
We would have to see your code to get an idea of what is causing your<br>
specific problems.<br>
<font color="#888888"><br>
Blaise<br>
</font><div><div></div><div class="h5"><br>
On Thu, 2010-04-15 at 00:31 -0700, Patrick Bouffard wrote:<br>
> Could anyone point out a good example using rospy of how to properly<br>
> listen to more than one subscribed topic (the inputs), as well as<br>
> publish one or more topics (the outputs) that are somehow dependent on<br>
> the inputs? In particular, one of the input topics is a joystick<br>
> message. I imagine this will involve threading, and I have made some<br>
> attempts using threading.Thread, with Events, Locks, etc., with<br>
> limited success.<br>
><br>
> Some of the things I'm seeing include:<br>
> - the joystick apparently not sending messages for a few seconds at a<br>
> time (when it should be sending them at around 20 Hz),<br>
> - Ctrl+C not being caught (when run with roslaunch, it eventually has<br>
> to escalate to SIGKILL every time which I think means that I'm doing<br>
> something wrong),<br>
> - Locks and Events not behaving as they should (at least as far as I<br>
> understand them; I've done very little threaded Python before)<br>
><br>
> A good example of the Right Way would be very helpful, or even just<br>
> some general advice.<br>
><br>
> Thanks,<br>
> Pat<br>
> _______________________________________________<br>
> ros-users mailing list<br>
> <a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
> <a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
<br>
<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>J.<br><br>