old_contents: #!/usr/bin/env python
  
  from flexbe_core import EventState, Logger
  import rospy
  from wm_tts.msg import say
  
  class SaraSayAsync(EventState):
      """
      Make sara say something
  
      -- sentence     string      what to say
      -- emotion     int       how to feel
  
      <= done                what's said is said
      """
  
      def __init__(self, sentence, emotion):
          """Constructor"""
  
          super(SaraSayAsync, self).__init__(outcomes = ['done'])
          self.sentence = sentence
          self.emotion = emotion
  
      def execute(self, userdata):
          """Wait for action result and return outcome accordingly"""
  
          pub = rospy.Publisher("/say", say, queue_size=1)
          msg = say()
          msg.sentence = self.sentence
          msg.emotion = self.emotion
          pub.publish(msg)
  
          Logger.loginfo('Publishing done')
  
  
          return 'done'
  
  
new_contents: #!/usr/bin/env python
  
  from flexbe_core import EventState, Logger
  import rospy
  from wm_tts.msg import say
  
  class SaraSayAsync(EventState):
      """
      Make sara say something
  
      -- sentence     string      what to say
      -- emotion     int       how to feel
  
      <= done                what's said is said
      """
  
      def __init__(self, sentence, emotion):
          """Constructor"""
  
          super(SaraSayAsync, self).__init__(outcomes = ['done'])
          self.sentence = sentence
          self.emotion = emotion
          self.pub = rospy.Publisher("/say", say, queue_size=1)
  
      def execute(self, userdata):
          """Wait for action result and return outcome accordingly"""
  
          self.pub.publish(self.sentence, self.emotion)
          Logger.loginfo('Publishing done')
  
  
          return 'done'
  
  
subject: fix say async