Chris,<div><br></div><div>I can't reproduce this error on my machine. For me, the sleep happens, then the node waits 10 seconds and exits.</div><div><br></div><div>Also, you should probably re-post this question on <a href="http://answers.ros.org">answers.ros.org</a> instead of this list. Its a much nicer forum for answering these kinds of questions as it supports better search and voting than the mailing list. When you re-post, it'd also be helpful to see the error message you're receiving.</div>
<div><br></div><div>Hope all is well,</div><div><br></div><div>Eitan</div><div><br><div class="gmail_quote">On Thu, Jun 16, 2011 at 2:31 PM, Chris Bersch <span dir="ltr"><<a href="mailto:chris.bersch@gmail.com">chris.bersch@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<br>
<br>
I ran into a problem when I ran python scripts where an actionlib<br>
action client is intantiated right after the node a the<br>
wait_for_server() function does not seem to work properly (it just<br>
does not wait).<br>
<br>
<br>
if __name__ == '__main__':<br>
   rospy.init_node('test_manipulation')<br>
#    rospy.sleep(1.0)<br>
<br>
   trajClient =<br>
actionlib.SimpleActionClient("r_arm_controller/joint_trajectory_action",<br>
pr2_controllers_msgs.msg.JointTrajectoryAction)<br>
   if not trajClient.wait_for_server(rospy.Duration(10.0)):<br>
       rospy.logerr("Could not connect to actionserver " )<br>
       exit(1)<br>
<br>
<br>
will return immediately with an error, even though I would expect it<br>
to wait 10s. If I uncomment rospy.sleep(1.0), everything works always<br>
as expected. Is there a more elegant solution to this?<br>
<br>
Chris<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>
</blockquote></div><br></div>