[ros-users] handling multiple topics in Python

Blaise Gassend blaise at willowgarage.com
Thu Apr 15 16:04:41 UTC 2010

Hi Pat,

You could have a look at the pr2_dashboard_aggregator. It has many
inputs and a single output and needs no locking at all.

We would have to see your code to get an idea of what is causing your
specific problems.


On Thu, 2010-04-15 at 00:31 -0700, Patrick Bouffard wrote:
> Could anyone point out a good example using rospy of how to properly
> listen to more than one subscribed topic (the inputs), as well as
> publish one or more topics (the outputs) that are somehow dependent on
> the inputs? In particular, one of the input topics is a joystick
> message. I imagine this will involve threading, and I have made some
> attempts using threading.Thread, with Events, Locks, etc., with
> limited success.
> Some of the things I'm seeing include:
> - the joystick apparently not sending messages for a few seconds at a
> time (when it should be sending them at around 20 Hz),
> - Ctrl+C not being caught (when run with roslaunch, it eventually has
> to escalate to SIGKILL every time which I think means that I'm doing
> something wrong),
> - Locks and Events not behaving as they should (at least as far as I
> understand them; I've done very little threaded Python before)
> A good example of the Right Way would be very helpful, or even just
> some general advice.
> Thanks,
> Pat
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users

More information about the ros-users mailing list