ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I'm not sure what can be the exact cause of your error. However I'd say you're using the wrong tool for this job. From the ROS wiki:

As the Parameter Server is not designed for high-performance, it is best used for static, non-binary data such as configuration parameters.

Instead I would try to set-up a ROS service using code similar to this:

from std_srvs.srv import Empty
class Bar:
    def sync_callback(self, req):
        self.foo = False
    def __init__(self):
        rospy.init_node("example")
        self.foo = True
        self.sync_service = rospy.Service("sync", Empty, self.sync_callback)
    def run(self):
        while self.foo:
           #rest of code as usual

if __name__ == '__main__':
    b = Bar()
    b.run()

Hope this helps!