20 from cob_msgs.msg
import EmergencyStopState
22 from simple_script_server
import *
33 rospy.Subscriber(
"/emergency_stop_state", EmergencyStopState, self.
em_cb, queue_size=1)
37 rospy.loginfo(
"[auto_init]: Waiting for %s to start...", component)
38 rospy.wait_for_service(
"/" + component +
"/driver/init")
41 while not rospy.is_shutdown():
43 rospy.loginfo(
"[auto_init]: Waiting for emergency stop to be released...")
46 except rospy.exceptions.ROSInterruptException
as e:
50 rospy.loginfo(
"[auto_init]: Initializing components")
53 while not rospy.is_shutdown():
55 rospy.logerr(
"[auto_init]: Could not initialize %s after %s retries", component, str(retries))
58 handle = sss.init(component)
59 if not (handle.get_error_code() == 0):
60 rospy.logerr(
"[auto_init]: Could not initialize %s. Retrying...(%s of %s, waiting for %.1f s to retry...)", component, str(retries), str(self.
max_retries), self.
retry_delay)
63 rospy.loginfo(
"[auto_init]: Component %s initialized successfully", component)