Skip to content

Commit

Permalink
start actionserver after initialize in soundplay_node.py
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 committed Jul 16, 2021
1 parent 4f51ea7 commit 023ca9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound_play/scripts/soundplay_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ def __init__(self):
self.mutex = threading.Lock()
sub = rospy.Subscriber("robotsound", SoundRequest, self.callback)
self._as = actionlib.SimpleActionServer('sound_play', SoundRequestAction, execute_cb=self.execute_cb, auto_start = False)
self._as.start()

self.mutex.acquire()
self.sleep(0.5) # For ros startup race condition
Expand All @@ -452,6 +451,8 @@ def __init__(self):
self.no_error = True
self.initialized = True
self.mutex.release()
if not self._as.action_server.started:
self._as.start()
try:
self.idle_loop()
# Returns after inactive period to test device availability
Expand Down

0 comments on commit 023ca9a

Please sign in to comment.