Re: [ros-users] rospy.sleep() blocking callbacks

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ken Conley
Date:  
To: ros-users
Subject: Re: [ros-users] rospy.sleep() blocking callbacks
You probably shouldn't call sleep inside of a click callback -- this
applies to any form of sleep, not just rospy. I haven't used
Python/Tk, but, in general, sleeping event callbacks in GUI apps leads
to all sorts of bad problems.

- Ken

On Tue, Jul 6, 2010 at 3:05 PM, Dan Lazewatsky <> wrote:
> I'm writing on a GUI in Python/Tk - I have a subscriber which is
> listening for image messages and setting a class member variable with
> the newest image, and a GUI element that needs to use image (after
> sending a message to move a pan/tilt). On click I use rospy.sleep() to
> wait for the pan/tilt to settle down before using any images. However,
> I've noticed that once I call rospy.sleep() inside the click callback,
> the callback for the image subscriber stops getting called. It was my
> understanding that subscriber callbacks are run asynchronously in
> their own thread, so a sleep in a different thread should have no
> effect. What's going on here? What am I missing?
>
> Thanks,
> -Dan
> _______________________________________________
> ros-users mailing list
>
> https://code.ros.org/mailman/listinfo/ros-users
>