Skip to content

Commit

Permalink
Merge pull request #109 from duckietown/daffy-staging
Browse files Browse the repository at this point in the history
don't crash when the service is not found - just ignore
  • Loading branch information
liampaull authored May 30, 2023
2 parents 34ca1a4 + 20ff807 commit 7f73c62
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/fsm/src/fsm_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ def __init__(self):

for node_name, service_name in list(nodes.items()):
rospy.loginfo(f"FSM waiting for service {service_name}")
rospy.wait_for_service(
service_name, timeout=10.0
) # Not sure if there is a better way to do this
self.srv_dict[node_name] = rospy.ServiceProxy(service_name, SetBool)
rospy.loginfo(f"FSM found service {service_name}")
try:
rospy.wait_for_service(
service_name, timeout=10.0
) # Not sure if there is a better way to do this
self.srv_dict[node_name] = rospy.ServiceProxy(service_name, SetBool)
rospy.loginfo(f"FSM found service {service_name}")
except rospy.ROSException as e:
rospy.logwarn(f"{e}")

# to change the LEDs
self.changePattern = rospy.ServiceProxy("~set_pattern", ChangePattern)
Expand Down

0 comments on commit 7f73c62

Please sign in to comment.