def checkNodeExistence(stat):
    global nodes, speak_text
    result = {}
    have_dead = False
    for n in nodes:
        res = ping(n, max_count=1, verbose=False)
        result[n] = res
        if not res:
            have_dead = True
    if have_dead:
        stat.summary(
            diagnostic_msgs.msg.DiagnosticStatus.ERROR,
            "dead nodes: " + ", ".join([n for (n, res) in result.items() if not res]),
        )
        if speak:
            sound = SoundRequest()
            sound.sound = SoundRequest.SAY
            sound.command = SoundRequest.PLAY_ONCE
            if speak_text:
                sound.arg = speak_text
            else:
                sound.arg = " ".join(nodes).replace("/", "").replace("_", " ") + " is dead"
            g_robotsound_pub.publish(sound)
    else:
        stat.summary(diagnostic_msgs.msg.DiagnosticStatus.OK, "every node is alive")
    for n, res in result.items():
        stat.add(n, res)
    return stat
def trig():
    g_odom_init_trigger_pub.publish(Empty())
    # Say something
    sound = SoundRequest()
    sound.sound = SoundRequest.SAY
    sound.command = SoundRequest.PLAY_ONCE
    sound.arg = "Robot stans on the ground."
    g_robotsound_pub.publish(sound)
 def gui(self, displayType, text, choices, timeout):
     if self.use_speech:
         req = SoundRequest()
         req.sound = SoundRequest.SAY
         req.command = SoundRequest.PLAY_ONCE
         req.arg = text
         self.sound_publisher.publish(req)
     return self._gui(displayType, text, choices, timeout)
示例#4
0
    def say(self, text_msg):
        msg = SoundRequest()
        msg.sound = SoundRequest.SAY
        msg.command = SoundRequest.PLAY_START
        msg.arg = text_msg

        self.sound_pub.publish(msg)
        time.sleep(2)
示例#5
0
 def speak(self, speak_str):
     rospy.logerr("[%s] %s", self.__class__.__name__, speak_str)
     if self.speak_enabled:
         msg = SoundRequest()
         msg.sound = SoundRequest.SAY
         msg.command = SoundRequest.PLAY_ONCE
         msg.arg = speak_str
         self.speak_pub.publish(msg)
 def speak(self, speak_str):
     rospy.logerr("[%s] %s", self.__class__.__name__, speak_str)
     if self.speak_enabled:
         msg = SoundRequest()
         msg.sound = SoundRequest.SAY
         msg.command = SoundRequest.PLAY_ONCE
         msg.arg = speak_str
         self.speak_pub.publish(msg)
示例#7
0
def trig():
    g_odom_init_trigger_pub.publish(Empty())
    # Say something
    sound = SoundRequest()
    sound.sound = SoundRequest.SAY
    sound.command = SoundRequest.PLAY_ONCE
    sound.arg = "Robot stans on the ground."
    g_robotsound_pub.publish(sound)
示例#8
0
  def say(self, text_msg):
	msg = SoundRequest()
	msg.sound = SoundRequest.SAY
	msg.command = SoundRequest.PLAY_START
	msg.arg = text_msg

	self.sound_pub.publish(msg)
	time.sleep(2)
示例#9
0
def speak(string):
    global speak_pub
    rospy.logerr(string)
    msg = SoundRequest()
    msg.sound = SoundRequest.SAY
    msg.command = SoundRequest.PLAY_ONCE
    msg.arg = string
    speak_pub.publish(msg)
示例#10
0
def speak(string):
    global speak_pub
    rospy.logerr(string)
    msg = SoundRequest()
    msg.sound = SoundRequest.SAY
    msg.command = SoundRequest.PLAY_ONCE
    msg.arg = string
    speak_pub.publish(msg)
示例#11
0
文件: woz.py 项目: s9wischu/Botinator
    def do_GET(self):
        global publisher
        query_string = urlparse.urlparse(self.path).query
        parameters = urlparse.parse_qs(query_string)

        if 'type' not in parameters:
            try:
                if self.path == "/":
                    self.path = "/index.html"
                elif self.path == "favicon.ico":
                    return
                elif self.path == "map.gif":
                    # Draw robot position on map and send image back
                    draw_map()
                    return
                fname,ext = os.path.splitext(self.path)
                print "Loading file", self.path
                with open(os.path.join(os.getcwd(),self.path[1:])) as f:
                    self.send_response(200)
                    self.send_header('Content-type', types_map[ext])
                    self.end_headers()
                    self.wfile.write(f.read())
                return
            except IOError:
                self.send_error(404)
                return

        command_type = parameters['type'][0]
        
        if command_type == 'base':
            base_x = 0.0
            if 'x' in parameters:
                base_x = float(parameters['x'][0])
            base_y = 0.0
            if 'y' in parameters:
                base_y = float(parameters['y'][0])
            base_z = 0.0
            if 'z' in parameters:
                base_z = float(parameters['z'][0])
            twist_msg = Twist()
            twist_msg.linear = Vector3(base_x, base_y, 0.0)
            twist_msg.angular = Vector3(0.0, 0.0, base_z)
            mobile_base_velocity.publish(twist_msg)

        elif command_type == 'speak':
            text = parameters['say'][0]
            sr = SoundRequest()
            sr.sound = -3 #Say text
            sr.command = 1 #Play once
            sr.arg = text
            publisher.publish(sr)
            #os.system("espeak -s 155 -a 200 '" + text + "' ")


        # response
        self.send_response(204)
        return
示例#12
0
def main():
	global bumper
	global direction
	print("Initialisation")
	rospy.init_node('scenario')
	rospy.sleep(0.5)
	rospy.Subscriber("/mobile_base/events/bumper", BumperEvent, bumper)
	pub1 = rospy.Publisher("/mobile_base/commands/velocity", Twist)
	pub2 = rospy.Publisher("/robotsound", SoundRequest)
	pub3 = rospy.Publisher("/mobile_base/commands/sound", Sound)
	cmd = Twist()
	sound = SoundRequest()
	bip = Sound()
	sound.arg = "/opt/ros/indigo/share/sound_play/sounds/R2D2a.wav"
	sound.sound = -2
	sound.command = 1
	bip.value=4
	while not rospy.is_shutdown():

		duree= 1+random.random()*5
		tempsActuel = rospy.get_time()
		stop = rospy.get_time() + duree
		while (rospy.get_time() < stop):
			if bumper==0:
				cmd.linear.x = 0
				cmd.angular.z = 0
				pub2.publish(sound)
				rospy.sleep(0.5)
				pub1.publish(cmd)
				rospy.sleep(5)
				cmd.linear.x = -0.2
				cmd.angular.z = -2
				cmd.angular.z = -2
				pub1.publish(cmd)
				rospy.sleep(0.5)
				bumper == 3
			elif bumper==1:
				cmd.linear.x = -0.2
				pub1.publish(cmd)
				pub3.publish(bip)
				rospy.sleep(0.5)
				bumper == 3
			elif bumper==2:
				cmd.linear.x = 0
				cmd.angular.z = 2
				pub1.publish(cmd)
				rospy.sleep(0.5)
				bumper== 3
			else:
				cmd.linear.x = 0.2
				cmd.angular.z = 0
				pub1.publish(cmd)
		if bumper>2:
			bumper = math.floor(random.random()*10)

	print("The End")
	rospy.spin()
示例#13
0
def bumper_callback(msg):
    if msg.data == True:
        sound_msg = SoundRequest()
        sound_msg.sound = -2
        # play file
        sound_msg.command = 1
        # play once
        sound_msg.arg = sound_file
        sound_pub.publish(sound_msg)
示例#14
0
 def play_sound(self, key, timeout=5.0):
     if self.act_sound is None:
         return
     req = SoundRequest()
     req.sound = SoundRequest.PLAY_FILE
     req.command = SoundRequest.PLAY_ONCE
     req.arg = self.signals[key]
     goal = SoundRequestGoal(sound_request=req)
     self.act_sound.send_goal_and_wait(goal, rospy.Duration(timeout))
    def play_sound(self):

        req = SoundRequest()

        req.sound = 3
        req.command = 1
        req.volume = 1.

        self.sound_pub.publish(req)
示例#16
0
def main():
    global bumper
    global direction
    print("Initialisation")
    rospy.init_node('scenario')
    rospy.sleep(0.5)
    rospy.Subscriber("/mobile_base/events/bumper", BumperEvent, bumper)
    pub1 = rospy.Publisher("/mobile_base/commands/velocity", Twist)
    pub2 = rospy.Publisher("/robotsound", SoundRequest)
    pub3 = rospy.Publisher("/mobile_base/commands/sound", Sound)
    cmd = Twist()
    sound = SoundRequest()
    bip = Sound()
    sound.arg = "/opt/ros/indigo/share/sound_play/sounds/R2D2a.wav"
    sound.sound = -2
    sound.command = 1
    bip.value = 4
    while not rospy.is_shutdown():

        duree = 1 + random.random() * 5
        tempsActuel = rospy.get_time()
        stop = rospy.get_time() + duree
        while (rospy.get_time() < stop):
            if bumper == 0:
                cmd.linear.x = 0
                cmd.angular.z = 0
                pub2.publish(sound)
                rospy.sleep(0.5)
                pub1.publish(cmd)
                rospy.sleep(5)
                cmd.linear.x = -0.2
                cmd.angular.z = -2
                cmd.angular.z = -2
                pub1.publish(cmd)
                rospy.sleep(0.5)
                bumper == 3
            elif bumper == 1:
                cmd.linear.x = -0.2
                pub1.publish(cmd)
                pub3.publish(bip)
                rospy.sleep(0.5)
                bumper == 3
            elif bumper == 2:
                cmd.linear.x = 0
                cmd.angular.z = 2
                pub1.publish(cmd)
                rospy.sleep(0.5)
                bumper == 3
            else:
                cmd.linear.x = 0.2
                cmd.angular.z = 0
                pub1.publish(cmd)
        if bumper > 2:
            bumper = math.floor(random.random() * 10)

    print("The End")
    rospy.spin()
示例#17
0
文件: wrapper.py 项目: pr3mar/ROS
def speak_robot(str_speech):
    #this doesnt work the first time - nobody knows why???
    #print str_speech
    tmp = SoundRequest()
    tmp.sound = -3
    tmp.command = 1
    tmp.arg = str_speech
    tmp.arg2 = ''
    global voice_pub
    voice_pub.publish(tmp)
示例#18
0
    def beep(self, key, blocking=False, **kwargs):
        """Play one of the beeps and boops that we know of"""
        if not key or key.upper() not in self.beeps:
            return

        sound = SoundRequest()
        sound.sound = SoundRequest.PLAY_FILE
        sound.command = SoundRequest.PLAY_ONCE
        sound.arg = self.beeps[key.upper()]
        self._play(sound, blocking=blocking, **kwargs)
示例#19
0
 def sendMsg(self, snd, cmd, s, arg2=""):
     msg = SoundRequest()
     msg.sound = snd
     msg.command = cmd
     msg.arg = s
     msg.arg2 = arg2 
     self.pub.publish(msg)
     ## @todo this should be a warn once warns become visible on the console.
     if self.pub.get_num_connections() < 1:
         rospy.logerr("Sound command issued, but no node is subscribed to the topic. Perhaps you forgot to run soundplay_node.py");
示例#20
0
    def stop(self):
        """Stop all sounds"""
        self.sound_client.cancel_all_goals()

        # Send a stop request
        sound = SoundRequest()
        sound.sound = SoundRequest.ALL
        sound.command = SoundRequest.PLAY_STOP
        sound.arg = ""

        self._play(sound, blocking=True)
示例#21
0
def trig():
    global is_servo_on
    g_odom_init_trigger_pub.publish(Empty())
    if is_servo_on is False:
        return
    # Say something
    sound = SoundRequest()
    sound.sound = SoundRequest.SAY
    sound.command = SoundRequest.PLAY_ONCE
    sound.arg = "Robot stands on the ground."
    g_robotsound_pub.publish(sound)
示例#22
0
 def sendMsg(self, snd, cmd, s):
     msg = SoundRequest()
     msg.sound = snd
     msg.command = cmd
     msg.arg = s
     self.pub.publish(msg)
     ## @todo this should be a warn once warns become visible on the console.
     if self.pub.get_num_connections() < 1:
         rospy.logerr(
             "Sound command issued, but no node is subscribed to the topic. Perhaps you forgot to run soundplay_node.py"
         )
def trig():
    global is_servo_on
    g_odom_init_trigger_pub.publish(Empty())
    if is_servo_on is False:
        return
    # Say something
    sound = SoundRequest()
    sound.sound = SoundRequest.SAY
    sound.command = SoundRequest.PLAY_ONCE
    sound.arg = "Robot stands on the ground."
    g_robotsound_pub.publish(sound)
示例#24
0
def main():
    pub = rospy.Publisher('robotsound', SoundRequest, queue_size=10)
    rospy.sleep(0.1)
    msg = SoundRequest()
    msg.sound = -3
    msg.command = 1
    msg.arg2 = 'voice_kal_diphone'
    while not rospy.is_shutdown():
        msg.arg = raw_input("Enter Command: ")
        if msg.arg=="exit":
            return
        pub.publish(msg)
def main():
	global bumper
	print("Lancement navigation aleatoire")
	rospy.init_node('navigation_aleatoire')
	rospy.sleep(0.5)
	rospy.Subscriber("/mobile_base/events/bumper", BumperEvent, bumper)
	pub = rospy.Publisher("/mobile_base/commands/velocity", Twist)
	pub2 = rospy.Publisher("/robotsound", SoundRequest)
	pub3 = rospy.Publisher("/mobile_base/commands/sound", Sound)
	cmd = Twist()
	sound = SoundRequest()
	sonnerie = Sound()
	sound.arg = "/opt/ros/indigo/share/sound_play/sounds/R2D2a.wav"
	sound.sound = -2
	sound.command = 1
	sonnerie.value= 4

	while not rospy.is_shutdown():

		duree= 1+random.random()*5
		tempsActuel = rospy.get_time()
		stop = rospy.get_time() + duree
		while (rospy.get_time() < stop):
			if bumper==0:
				cmd.linear.x = 0
				cmd.angular.z = -2
				pub.publish(cmd)
				rospy.sleep(0.5)
				bumper=3
			elif bumper==1:
				cmd.linear.x = -0.2
				cmd.angular.z = 0
				pub.publish(cmd)
				pub2.publish(sound)
				rospy.sleep(0.5)
				bumper=3
			elif bumper==2:
				cmd.linear.x = 0
				cmd.angular.z = 2
				pub.publish(cmd)
				rospy.sleep(0.5)
				bumper=3
			else:
				cmd.linear.x = 0.2
				cmd.angular.z = 0
				pub.publish(cmd)
		if bumper>2:
			bumper = math.floor(random.random()*10)
		print(sound)

	print("fin navigation autonome")
	rospy.spin() #boucle infinie tant qu'on quitte pas proprement
def main():
    global bumper
    print("Lancement navigation aleatoire")
    rospy.init_node('navigation_aleatoire')
    rospy.sleep(0.5)
    rospy.Subscriber("/mobile_base/events/bumper", BumperEvent, bumper)
    pub = rospy.Publisher("/mobile_base/commands/velocity", Twist)
    pub2 = rospy.Publisher("/robotsound", SoundRequest)
    pub3 = rospy.Publisher("/mobile_base/commands/sound", Sound)
    cmd = Twist()
    sound = SoundRequest()
    sonnerie = Sound()
    sound.arg = "/opt/ros/indigo/share/sound_play/sounds/R2D2a.wav"
    sound.sound = -2
    sound.command = 1
    sonnerie.value = 4

    while not rospy.is_shutdown():

        duree = 1 + random.random() * 5
        tempsActuel = rospy.get_time()
        stop = rospy.get_time() + duree
        while (rospy.get_time() < stop):
            if bumper == 0:
                cmd.linear.x = 0
                cmd.angular.z = -2
                pub.publish(cmd)
                rospy.sleep(0.5)
                bumper = 3
            elif bumper == 1:
                cmd.linear.x = -0.2
                cmd.angular.z = 0
                pub.publish(cmd)
                pub2.publish(sound)
                rospy.sleep(0.5)
                bumper = 3
            elif bumper == 2:
                cmd.linear.x = 0
                cmd.angular.z = 2
                pub.publish(cmd)
                rospy.sleep(0.5)
                bumper = 3
            else:
                cmd.linear.x = 0.2
                cmd.angular.z = 0
                pub.publish(cmd)
        if bumper > 2:
            bumper = math.floor(random.random() * 10)
        print(sound)

    print("fin navigation autonome")
    rospy.spin()  #boucle infinie tant qu'on quitte pas proprement
示例#27
0
def customerLoggedIn(customer):
    global userId, subCamDepth, userTime, userTimeDelta, pubSound, state
    
    rospy.loginfo("user logged in")
    
    # TODO: support more than one gender.
    
    # Say welcome message
    soundRequest = SoundRequest()
    soundRequest.sound = -3 #Say text
    soundRequest.command = 1 #Play once 
    soundRequest.arg = "Welcome, Mister " + customer + "!"
    pubSound.publish(soundRequest)
示例#28
0
 def play_sound(self, path, timeout=5.0):
     if self.act_sound is None:
         return
     req = SoundRequest()
     req.sound = SoundRequest.PLAY_FILE
     req.command = SoundRequest.PLAY_ONCE
     if hasattr(
             SoundRequest, 'volume'
     ):  # volume is added from 0.3.0 https://github.com/ros-drivers/audio_common/commit/da9623414f381642e52f59701c09928c72a54be7#diff-fe2d85580f1ccfed4e23a608df44a7f7
         sound.volume = 1.0
     req.arg = path
     goal = SoundRequestGoal(sound_request=req)
     self.act_sound.send_goal_and_wait(goal, rospy.Duration(timeout))
示例#29
0
    def say(self, text, affect="", blocking=False, **kwargs):
        """Perform TTS using SSML"""

        # Transform the text if the affect argument calls for it
        if affect and affect.upper() in self.affects.keys():
            text = self.affects[affect.upper()](text)

        # Create the vars for the SSML query
        text = SoundClient.SSML_TEMPLATE.format(speech=text)
        query_dict = {
            'INPUT_TEXT': text,
            'INPUT_TYPE': 'SSML',
            'LOCALE': 'en_GB',
            'VOICE': 'dfki-prudence-hsmm',
            'OUTPUT_TYPE': 'AUDIO',
            'AUDIO': 'WAVE',
            # 'effect_Robot_selected': 'on',
            # 'effect_Robot_parameters': 'amount:60.0',
        }

        # Send a request to MARY and check the response type
        r = requests.post(SoundClient.MARY_SERVER_URL,
                          params=query_dict,
                          timeout=SoundClient.MARY_SERVER_TIMEOUT)
        if r.headers['content-type'] != 'audio/x-wav':
            rospy.logerr("Response Error Code: {}. Content-Type: {}".format(
                r.status_code, r.headers['content-type']))
            raise ValueError("Incorrect Content Type",
                             r.headers['content-type'], r.status_code)

        # Increase the volume on the temp file
        speech = AudioSegment(data=r.content)
        speech = speech + SoundClient.SPEECH_GAIN_DB
        speech = SoundClient.change_audio_speed(speech, 0.95)
        speech = speech.set_frame_rate(int(speech.frame_rate * 2.0))

        # Write the wav data to a temp file
        speech_filename = create_temp_filename(prefix='marytts', suffix='.wav')
        with open(speech_filename, 'wb') as fd:
            speech.export(speech_filename, format='wav')

        # Now send the file's name over to sound play
        sound = SoundRequest()
        sound.sound = SoundRequest.PLAY_FILE
        sound.command = SoundRequest.PLAY_ONCE
        sound.arg = speech_filename
        self._play(sound, blocking=blocking, **kwargs)

        # Send the file to the cleanup thread now
        self._tmp_speech_files.put(speech_filename)
示例#30
0
    def sendMsg(self, snd, cmd, s, arg2="", **kwargs):
        """
        Internal method that publishes the sound request, either directly as a
        SoundRequest to the soundplay_node or through the actionlib interface
        (which blocks until the sound has finished playing).

        The blocking behavior is nominally the class-wide setting unless it has
        been explicitly specified in the play call.
        """

        # Use the passed-in argument if it exists, otherwise fall back to the
        # class-wide setting.
        blocking = kwargs.get('blocking', self._blocking)

        msg = SoundRequest()
        msg.sound = snd
        msg.command = cmd
        msg.arg = s
        msg.arg2 = arg2

        rospy.logdebug('Sending sound request with'
                       ' blocking = {}'.format(blocking))

        # Defensive check for the existence of the correct communicator.
        if not blocking and not self.pub:
            rospy.logerr('Publisher for SoundRequest must exist')
            return
        if blocking and not self.actionclient:
            rospy.logerr('Action client for SoundRequest does not exist.')
            return

        if not blocking:  # Publish message directly and return immediately
            self.pub.publish(msg)
            if self.pub.get_num_connections() < 1:
                rospy.logwarn("Sound command issued, but no node is subscribed"
                              " to the topic. Perhaps you forgot to run"
                              " soundplay_node.py?")
        else:  # Block until result comes back.
            assert self.actionclient, 'Actionclient must exist'
            rospy.logdebug('Sending action client sound request [blocking]')
            self.actionclient.wait_for_server()
            goal = SoundRequestGoal()
            goal.sound_request = msg
            self.actionclient.send_goal(goal)
            self.actionclient.wait_for_result()
            rospy.logdebug('sound request response received')

        return
示例#31
0
 def announcement_worker(self):
     while not rospy.is_shutdown():
         self.announceCV.acquire()
         if len(self.announcements) > 0:
             msg = SoundRequest()
             msg.sound = SoundRequest.SAY
             msg.command = SoundRequest.PLAY_ONCE
             msg.arg = self.announcements.pop(0)
             msg.arg2 = 'voice.select "%s"'%self.voice
             self.audio_pub.publish(msg)
             duration = self.speech_delay + self.speech_rate*len(msg.arg)
             self.announceCV.wait(timeout=duration)
             self.announceCV.release()
         else:
             self.announceCV.wait(timeout=0.1)
             self.announceCV.release()
 def __init__(self, *args):
     super(self.__class__, self).__init__(*args)
     rospy.init_node(NAME)
     self.lock_for_msg = threading.Lock()
     self.msg = SoundRequest()
     self.action_server = \
             actionlib.SimpleActionServer( '/sound_play', SoundRequestAction, execute_cb=self.handler, auto_start=False)
     self.action_server.start()
示例#33
0
def checkNodeExistence(stat):
    global nodes, speak_text
    result = {}
    have_dead = False
    for n in nodes:
        res = ping(n, max_count=1, verbose=False)
        result[n] = res
        if not res:
            have_dead = True
    if have_dead:
        stat.summary(
            diagnostic_msgs.msg.DiagnosticStatus.ERROR, "dead nodes: " +
            ", ".join([n for (n, res) in result.items() if not res]))
        if speak:
            sound = SoundRequest()
            sound.sound = SoundRequest.SAY
            sound.command = SoundRequest.PLAY_ONCE
            if hasattr(
                    SoundRequest, 'volume'
            ):  # volume is added from 0.3.0 https://github.com/ros-drivers/audio_common/commit/da9623414f381642e52f59701c09928c72a54be7#diff-fe2d85580f1ccfed4e23a608df44a7f7
                sound.volume = 1.0
            if speak_text:
                sound.arg = speak_text
            else:
                sound.arg = " ".join(nodes).replace("/", "").replace(
                    "_", " ") + " is dead"
            g_robotsound_pub.publish(sound)
    else:
        stat.summary(diagnostic_msgs.msg.DiagnosticStatus.OK,
                     "every node is alive")
    for n, res in result.items():
        stat.add(n, res)
    return stat
示例#34
0
文件: sendGoal.py 项目: pr3mar/ROS
    def commander(data):
        print "You said: "+data.data

        #now do sth with that data!
        names = ['Peter', 'Harry', 'Tina', 'Scarlet', 'Forest', 'Kim', 'Filip', 'Matthew', 'Ellen']
        objects = ['building']
        streets = ['street']
        colours = ['blue', 'yellow', 'green', 'red']
        sentence = data.data

        tokens = nltk.word_tokenize(sentence)
        print "Tokens:\n"
        print tokens

        #first word is name
        colour_building = None
        colour_street = None
        name = min_distance_one(tokens[0], names)

        building = min_distance_all(tokens, objects)
        if building[0] != None:
            colour_building = min_distance_one(tokens[building[1]-1], colours)

        street = min_distance_all(tokens, streets)
        if street[0] != None:
            colour_street = min_distance_one(tokens[street[1]-1], colours)

        print "Mission Impossible: %s %s %s %s %s"%(name,  colour_building, building[0], colour_street, street[0])

        #send robot to the right street
        rospy.Subscriber('move_base/status', GoalStatusArray, self.callback)
        
        #this doesnt work the first time - nobody knows why???
        str_speech = name + ", where would you like to go?"
        print str_speech
        tmp = SoundRequest()
        tmp.sound = -3
        tmp.command = 1
        tmp.arg = str_speech
        tmp.arg2 = ''
        
        pub = rospy.Publisher('/robotsound', SoundRequest, queue_size=1)
        pub.publish(tmp)
示例#35
0
 def speak_result(self, result):
     if self.sound_action is None:
         return
     msg = SoundRequest(command=SoundRequest.PLAY_ONCE,
                        sound=SoundRequest.SAY,
                        volume=1.0,
                        arg=result.fulfillment_text.encode('utf-8'),
                        arg2=self.language)
     self.sound_action.send_goal_and_wait(
         SoundRequestGoal(sound_request=msg), rospy.Duration(10.0))
示例#36
0
 def _speak(self, sentence):
     req = SoundRequest()
     req.command = SoundRequest.PLAY_ONCE
     req.sound = SoundRequest.SAY
     req.arg = sentence
     req.arg2 = 'ja'
     req.volume = 0.8
     self.speak_client.send_goal(SoundRequestGoal(sound_request=req))
     self.speak_client.wait_for_result(timeout=rospy.Duration(10))
示例#37
0
    def sendMsg(self, snd, cmd, s, arg2="", vol=1.0, prior = 1, **kwargs):
        """
        Internal method that publishes the sound request, either directly as a
        SoundRequest to the soundplay_node or through the actionlib interface
        (which blocks until the sound has finished playing).

        The blocking behavior is nominally the class-wide setting unless it has
        been explicitly specified in the play call.
        """

        # Use the passed-in argument if it exists, otherwise fall back to the
        # class-wide setting.
        blocking = kwargs.get('blocking', self._blocking)

        msg = SoundRequest()
        msg.sound = snd
        # Threshold volume between 0 and 1.
        msg.volume = max(0, min(1, vol))
        msg.command = cmd
        msg.arg = s
        msg.arg2 = arg2
        msg.priority = prior

        rospy.logdebug('Sending sound request with volume = {}'
                       ' and blocking = {}'.format(msg.volume, blocking))

        # Defensive check for the existence of the correct communicator.
        if not blocking and not self.pub:
            rospy.logerr('Publisher for SoundRequest must exist')
            return
        if blocking and not self.actionclient:
            rospy.logerr('Action client for SoundRequest does not exist.')
            return

        if not blocking:  # Publish message directly and return immediately
            self.pub.publish(msg)
            if self.pub.get_num_connections() < 1:
                rospy.logwarn("Sound command issued, but no node is subscribed"
                              " to the topic. Perhaps you forgot to run"
                              " soundplay_node.py?")
        else:  # Block until result comes back.
            assert self.actionclient, 'Actionclient must exist'
            rospy.logdebug('Sending action client sound request [blocking]')
            self.actionclient.wait_for_server()
            goal = SoundRequestGoal()
            goal.sound_request = msg
            self.actionclient.send_goal(goal)
            self.actionclient.wait_for_result()
            rospy.logdebug('sound request response received')

        return
def checkNodeExistence(stat):
    global nodes, speak_text
    result = {}
    have_dead = False
    for n in nodes:
        res = ping(n, max_count=1, verbose=False)
        result[n] = res
        if not res:
            have_dead = True
    if have_dead:
        stat.summary(
            diagnostic_msgs.msg.DiagnosticStatus.ERROR, "dead nodes: " +
            ", ".join([n for (n, res) in result.items() if not res]))
        if speak:
            sound = SoundRequest()
            sound.sound = SoundRequest.SAY
            sound.command = SoundRequest.PLAY_ONCE
            if speak_text:
                sound.arg = speak_text
            else:
                sound.arg = " ".join(nodes).replace("/", "").replace(
                    "_", " ") + " is dead"
            g_robotsound_pub.publish(sound)
    else:
        stat.summary(diagnostic_msgs.msg.DiagnosticStatus.OK,
                     "every node is alive")
    for n, res in result.items():
        stat.add(n, res)
    return stat
示例#39
0
    def sendMsg(self, snd, cmd, s, arg2="", vol=1.0):
        msg = SoundRequest()
        msg.sound = snd
        
        if vol < 0:
            msg.volume = 0
        elif vol > 1.0:
            msg.volume = 1.0
        else:
            msg.volume = vol
        
        msg.command = cmd
        msg.arg = s
        msg.arg2 = arg2 
        self.pub.publish(msg)

        if self.pub.get_num_connections() < 1:
            rospy.logwarn("Sound command issued, but no node is subscribed to the topic. Perhaps you forgot to run soundplay_node.py?");
示例#40
0
文件: utils.py 项目: wklharry/hrl
    def execute(self, userdata):
        if not self.init:
            self.init = True
            self.pub = rospy.Publisher('robotsound', SoundRequest)
            rospy.sleep(1.0)

        self.pub.publish(SoundRequest(-3, 1, 'Ready to Move'))
        ui = ''
        while not (ui == '0' or ui == '1'):
            print '\'0\' or \'1\' when Ready.'
            ui = raw_input()

        return 'succeeded'
示例#41
0
def point_callback(data):
	global pub_audio
	global limbr
	global liml
	limbr = baxter_interface.Limb('right')
	limbl = baxter_interface.Limb('left')
	if data.x == 0 and data.y == 0 and data.z == 0:
		rospy.loginfo("Point: got a stop command (all zeros)")
	elif check_range([data.x, data.y, data.z]):
		rospy.loginfo("Point: setting target to" + str(data))
		limbr.move_to_joint_positions(point_joint_angles([data.x, data.y, 
		data.z]), threshold = 0.05)
		rospy.sleep(5)
		limbr.move_to_joint_positions(anglesr, threshold = 0.05)
		#limb.move_to_joint_positions(angles) #blocking
	else:
		msg = SoundRequest()
		msg.sound = -3
		msg.command = 1
		msg.arg = 'Quad is out of pointing range'
		msg.arg2 = 'voice_kal_diphone'
		pub_audio.publish(msg)
		rospy.loginfo("Point: target out of pointing range " + str(data))
示例#42
0
def decir(oracion):
    voice = SoundRequest()

    voice.sound = -3
    voice.command = 1
    voice.volume = 1.0
    voice.arg = oracion
    #voice.arg2='voice_el_diphone'
    pub_voice.publish(voice)
示例#43
0
def play_sound(sound,
               lang='',
               topic_name='robotsound',
               volume=1.0,
               wait=False):
    """
    Plays sound using sound_play server
    Args:
        sound: if sound is pathname, plays sound file located at given path
            if it is number, server plays builtin sound
            otherwise server plays sound as speech sentence
        topic-name: namespace of sound_play server
        wait: wait until sound is played
    """
    msg = SoundRequest(command=SoundRequest.PLAY_ONCE)
    if isinstance(sound, int):
        msg.sound = sound
    elif isinstance(sound, str) and Path(sound).exists():
        msg.sound = SoundRequest.PLAY_FILE
        msg.arg = sound
    elif isinstance(sound, str):
        msg.sound = SoundRequest.SAY
        msg.arg = sound
    else:
        raise ValueError

    if hasattr(msg, 'volume'):
        msg.volume = volume

    if topic_name in _sound_play_clients:
        client = _sound_play_clients[topic_name]
    else:
        client = actionlib.SimpleActionClient(topic_name, SoundRequestAction)
    client.wait_for_server()

    goal = SoundRequestGoal()
    if client.get_state() == actionlib_msgs.msg.GoalStatus.ACTIVE:
        client.cancel_goal()
        client.wait_for_result(timeout=rospy.Duration(10))
    goal.sound_request = msg
    _sound_play_clients[topic_name] = client
    client.send_goal(goal)

    if wait is True:
        client.wait_for_result(timeout=rospy.Duration(10))
    return client
示例#44
0
文件: utils.py 项目: wklharry/hrl
    def execute(self, userdata):
        if not self.init:
            self.init = True
            self.pub = rospy.Publisher('robotsound', SoundRequest)
            rospy.sleep(1.0)

        self.pub.publish(SoundRequest(-3, 1, 'MANUAL or SKIP'))
        ui = ''
        while not (ui == '0' or ui == '1'):
            print '\'0\' to Position Manually (position robot first)'
            print '\'1\' to skip this position'
            ui = raw_input()
        if ui == '0':
            return 'succeeded'  # Robot manually positioned
        else:
            return 'aborted'  # Forget this position
示例#45
0
    def __init__(self):
        self.inbag_filename = "2021-05-23-19-47-32.bag"
        self.next_pose = []
        self.path = Path()
        self.goal_pose = Point()

        self.read_rosbag()

        #print(self.next_pose)
        rospy.Subscriber('/uav/pose_ref', Pose, self.pose_callback)
        self.pub_sound = rospy.Publisher('/robotsound',
                                         SoundRequest,
                                         queue_size=1)
        self.pose = Pose()
        self.sound = SoundRequest()
        self.rate = rospy.Rate(0.5)
示例#46
0
    def say(self, text, is_using_sounds=False):
        '''Send a TTS (text to speech) command.

        This will cause the robot to verbalize text if not
        is_using_sounds. It will always display text in Rviz.

        Args:
            text (str): The speech to say / vizualize.
            is_using_sounds (bool): Whether the robot is beeping and
                booping (if True), which determines whether to actually
                speak the words (only if False).
        '''
        if not is_using_sounds:
            self.speech_publisher.publish(SoundRequest(
                command=SoundRequest.SAY, arg=text))
        self.say_in_rviz(text)
示例#47
0
 def speak(self, sentence):
     if self.speech_history[sentence] + rospy.Duration(self.warn_repeat_rate) > rospy.Time.now():
         return
     self.speech_history[sentence] = rospy.Time.now()
     req = SoundRequest()
     req.command = SoundRequest.PLAY_ONCE
     req.sound = SoundRequest.SAY
     req.arg = sentence
     req.arg2 = "ja"
     self.speak_client.send_goal(SoundRequestGoal(sound_request=req))
     self.speak_client.wait_for_result(timeout=rospy.Duration(10))
示例#48
0
 def __init__(self):
     self.pose = Pose()
     rospy.Subscriber('/uav/pose_ref', Pose, self.pose_callback)
     rospy.Subscriber('/uav/odometry', Odometry, self.twist_callback)
     self.vel = Odometry()
     self.control_mode = -1
     self.pub = rospy.Publisher('/uav/pose_ref', Pose, queue_size=1)
     self.pub_sound = rospy.Publisher('/robotsound',
                                      SoundRequest,
                                      queue_size=1)
     self.rate = rospy.Rate(1)
     self.point = Pose()
     self.sound = SoundRequest()
     self.point.position.z = 1
     self.pose_now = Pose()
     self.pose_prev = Pose()
     self.count = 0
#!/usr/bin/env python

import rospy
from sound_play.msg import SoundRequest
# topic --> /robotsound or /robotsound_jp

rospy.init_node("finish_launch_sound")
p = rospy.Publisher("/robotsound", SoundRequest)

rospy.sleep(5)                  # sleep to wait for connection
msg = SoundRequest()
msg.sound = SoundRequest.SAY
msg.command = SoundRequest.PLAY_START
msg.arg = "Launching"
p.publish(msg)
示例#50
0
#!/usr/bin/env python

import rospy
from sound_play.msg import SoundRequest
# topic --> /robotsound or /robotsound_jp

rospy.init_node("finish_launch_sound")
p = rospy.Publisher("/robotsound", SoundRequest)

rospy.sleep(5)                  # sleep to wait for connection
msg = SoundRequest()
msg.sound = SoundRequest.SAY
msg.command = SoundRequest.PLAY_ONCE
msg.arg = "Now I am ready"
p.publish(msg)
示例#51
0
 def speak(self, text):
     soundRequest = SoundRequest()
     soundRequest.sound = -3 #Say text
     soundRequest.command = 1 #Play once 
     soundRequest.arg = text
     ServerData.pubSound.publish(soundRequest)
示例#52
0
            #sh.play()
            rospy.loginfo(rospy.get_caller_id() + "A produit un son...")
        if data.command == SAY:
            entree = data.arg
            rospy.loginfo(rospy.get_caller_id() + "Va parler..." + entree)
            sh = soundhandle.say(entree)
            #sh.play()
            rospy.loginfo(rospy.get_caller_id() + "A parle...")
        rospy.sleep(2)

# On s'inscrit au topic
rospy.Subscriber("/robotsound", SoundRequest, callback)

if mode == modeTest:
        sh = soundhandle.say("Ready!")
        messageSon = SoundRequest()
        topicSon = rospy.Publisher("/robotsound", SoundRequest, queue_size=10)
	while True:
            print "Spike va dire (s pour son) "
            entree = raw_input(">")
            if entree != "s": 
                rospy.loginfo("Spike dit: " + entree)
                messageSon.command = SAY
                messageSon.arg = entree
                topicSon.publish(messageSon)
                print messageSon.command 
                
                #soundhandle.say(entree)
            else:
	    	rospy.loginfo("Joue un son.")
	    	messageSon.command = WAV
示例#53
0
    def __init__(self):
        """ 
        The main control loop for searching and recording victim locations
        """
        # States for the state machine
        self.state = enum(SEARCHING=1, INVESTIGATING=2, GO_HOME=3)
    
        rospy.init_node('random_nav')
        # setup publishers and subscribers
        self.ac = actionlib.SimpleActionClient("move_base", MoveBaseAction)
        rospy.Subscriber('/visualization_marker', Marker, self.marker_callback)
        rospy.Subscriber('/amcl_pose', PoseWithCovarianceStamped,
                            self.position_callback)
        rospy.Subscriber('/camera/rgb/image_raw', Image, self.image_callback)
        self.marker_pub = rospy.Publisher('victim_marker', Marker,
                                            queue_size=10)
        self._talk_pub = rospy.Publisher('/robotsound', SoundRequest,
                                            queue_size=10)
        rospy.Subscriber('map', OccupancyGrid, self.map_callback)
        self.tf_listener = tf.TransformListener()

        self.current_goal = (1000,1000)         # current nav goal
        self.TIME = 450                         # search time for robot
        self.old_goals = []                     # list of previous nav goals
        self.cv_bridge = CvBridge()             # for image conversion
        self.image = None                       # raw rgb image
        self.map_msg = None                     # sets up map
        self.victims = []                       # list of found victims
        self.start_time = rospy.get_time()      # start time of the robot
        self.home = False                       # signals when to go home
        self.position = None                    # robot's current position
        self.cur_state = self.state.SEARCHING   # current state of the robot
        self.cur_marker = Point()               # ar marker currently seen
        self.first_goal = True                  # signals if it is the 1st goal
        self.goals = 0                          # diagnostic count of old goals
        old_state = None                        # previous state of the robot

        # Set up a SoundRequest message:
        sound_request = SoundRequest()
        sound_request.sound = sound_request.SAY
        sound_request.command = sound_request.PLAY_ONCE
        sound_request.arg = "Report is Ready!"

        while self.map_msg is None and not rospy.is_shutdown():
            rospy.loginfo("Waiting for map...")
            rospy.sleep(.1)

        self.map = map_utils.Map(self.map_msg)

        while (self.position is None and not rospy.is_shutdown()):
            rospy.loginfo("Waiting for position...")
            rospy.sleep(.1)

        # sets the home postion
        home_pos = self.position

        # generate the first random goal
        x_goal = 100000
        y_goal = 100000

        while self.map.get_cell(x_goal, y_goal) != 0:
                    x_goal = random.random() * 20.0 - 10.0
                    y_goal = random.random() * 20.0 - 10.0
                    rospy.loginfo("Random goal found: ({}, {})".format(x_goal,
                                    y_goal))

        # main execution loop
        while not rospy.is_shutdown():
            local_marker = self.cur_marker
            local_state = self.cur_state

            # Go back to start after certain time limit
            local_state = self.go_home(local_state)

            # Set the goal to a random point
            if local_state is self.state.SEARCHING:
                goals = self.search(x_goal, y_goal, old_state)
                x_goal = goals[0]
                y_goal = goals[1]
            # Set the goal to the starting position
            elif local_state is self.state.GO_HOME:
                x_goal = home_pos.position.x
                y_goal = home_pos.position.y
            # Set the goal to the victim's position
            elif local_state is self.state.INVESTIGATING:
                local_state = self.investigate(local_state, local_marker)
                
            # Only set a new goal if the state has changed
            if (old_state is not local_state):
                goal = self.goal_message(x_goal, y_goal, 0)
                self.go_to_point(goal)
                self.old_goals.append((x_goal, y_goal))
                self.current_goal = (x_goal,y_goal)
        
            old_state = local_state
            self.cur_state = local_state

            # if going home, wait to reach goal then break out of loop
            if self.home:
                self.ac.wait_for_result()
                self._talk_pub.publish(sound_request)
                rospy.sleep(3)
                break
示例#54
0
#!/usr/bin/env python

import rospy
from sound_play.msg import SoundRequest
# topic --> /robotsound or /robotsound_jp

rospy.init_node("finish_launch_sound")
p = rospy.Publisher("/robotsound", SoundRequest)

rospy.sleep(5)                  # sleep to wait for connection
msg = SoundRequest()
msg.sound = SoundRequest.SAY
msg.command = SoundRequest.PLAY_ONCE
msg.arg = "Launching"
p.publish(msg)
示例#55
0
def cmd_callback(data):
	global juliaPos
        rospy.loginfo("got " + data.data)
	cmd = str(data.data).strip()
	if cmd == "hello baxter":
		rospy.loginfo("hello commander")
		msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'Hello Human'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                #os.system("espeak -v en 'hello commander'") #speaker?
	elif cmd == "point to the quad":
		'''
		if the quadrotor's positon is being published, its last known
		position should be stored in quadPos. If quadPos is None, no
		position has been reported.
		'''
		if quadPos:
			t = rospy.get_rostime()
			rospy.loginfo(str(t) + "," + str(lastPosTime))
			if lastPosTime != 0 and t - lastPosTime < currentPositionMaxDuration:
				msg = SoundRequest()
                                msg.sound = -3
                                msg.command = 1
                                msg.arg = 'I see the quad and am pointing to the quad'
                                msg.arg2 = 'voice_kal_diphone'
                                pub_audio.publish(msg)
                                pub_cmd.publish(quadPos)
				rospy.loginfo("Speech command: I see the quad and am pointing - sending command to point to " + 
				pos_str(quadPos))
			else:
				msg = SoundRequest()
                                msg.sound = -3
                                msg.command = 1
                                msg.arg = 'I no longer can see the quad'
                                msg.arg2 = 'voice_kal_diphone'
                                pub_audio.publish(msg)
                                rospy.loginfo("Speech command: I no longer can see the quad - last quad position is outdated: recorded at " + 
				pos_str(quadPos) + str(round((t - lastPosTime).to_sec(), 2))
				+ " seconds ago")
		else:
			msg = SoundRequest()
			msg.sound = -3
			msg.command = 1
			msg.arg = 'I do not see the quad'
			msg.arg2 = 'voice_kal_diphone'
			pub_audio.publish(msg)
			rospy.loginfo("No known quad location")
	elif cmd == "turn on the quad":
                msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'I do not know how to do that'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
		rospy.loginfo("Speech command: I do not know how to start quad")
	elif cmd == "move your right arm to the side":
                msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'moving my right arm to the side'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                amsg = String()
                amsg.data = "right_arm_side"
                pub_arm.publish(amsg)
		rospy.loginfo("Speech command: moving your right arm to the side")
	elif cmd == "move your left arm to the side":
                msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'moving my left arm to the side'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                amsg = String()
                amsg.data = "left_arm_side"
                pub_arm.publish(amsg)
		rospy.loginfo("Speech command: moving my left arm to the side")
	elif cmd == "move both of your arms to the side":
                msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'moving my arms to the side'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                amsg = String()
                amsg.data = "both_arms_side"
                pub_arm.publish(amsg)
		rospy.loginfo("Speech command: moving both of my arms to the side")
	elif cmd == "tuck your arms":
                msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'tucking my arms'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                amsg = String()
                amsg.data = "True"
                pub_tuck.publish(amsg)
		rospy.loginfo("Speech command: tucking arms")
	elif cmd == "untuck your arms":
                msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'untucking my arms'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                amsg = String()
                amsg.data = "False"
                pub_tuck.publish(amsg)
		rospy.loginfo("Speech command:untucking arms")
	elif cmd == "raise the quad":
		msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'I do not know how to do that'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                rospy.loginfo("I do not know how to raise quad")
	elif cmd == "lower the quad":
                msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'I do not know how to do that'
                msg.arg2 = 'voice_kal_diphone'		
                pub_audio.publish(msg)
                rospy.loginfo("Speech command: I do not know how to lower quad")
	elif cmd == "land the quad":
                msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'I do not know how to do that'
                msg.arg2 = 'voice_kal_diphone'	
                pub_audio.publish(msg)	
                rospy.loginfo("Speech command: I do not know how to land quad")
	elif cmd == "turn off the quad":
		msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'I do not know how to do that'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                rospy.loginfo("Speech command: I do not know how to turn off quad")
	elif cmd == "how are you":
		msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'I am fine'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                rospy.loginfo("Speech command: I am fine")
	elif cmd == "how are you doing":
		msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'I am fine'
                msg.arg2 = 'voice_kal_diphone'
                pub_audio.publish(msg)
                rospy.loginfo("Speech command: I am fine")
	elif "julia" in cmd:
		t = rospy.get_rostime()
                if havejulia and lastJuliaTime != 0 and t - lastJuliaTime < juliaPositionMaxDuration:
                    msg = SoundRequest()
                    msg.sound = -3
                    msg.command = 1
                    msg.arg = 'Julia is over there'
                    msg.arg2 = 'voice_kal_diphone'
                    pub_cmd.publish(juliaPos)
                    pub_audio.publish(msg)
                    rospy.sleep(2)
                    msg.arg = 'I am pointing at her'
                    pub_audio.publish(msg)
                    rospy.loginfo("Speech command: Julia is over there, pointing to her")
                else:
                    msg = SoundRequest()
                    msg.sound = -3
                    msg.command = 1
                    msg.arg = 'I am having trouble with my vision and am not sure that I see Julia'
                    msg.arg2 = 'voice_kal_diphone'
                    pub_audio.publish(msg)
                    rospy.loginfo("Speech command: Not sure I see Julia")
	else:
		msg = SoundRequest()
                msg.sound = -3
                msg.command = 1
                msg.arg = 'I did not understand that command'
                msg.arg2 = 'voice_kal_diphone'
                rospy.loginfo("command " + cmd + " not understood")
示例#56
0
def arm_callback(data):
	global pub_audio
	global limbl
	global limbr
	global anglesl
	global anglesr
	limbr = baxter_interface.Limb('right')
        limbl = baxter_interface.Limb('left')
	if data.data == "right_arm_side":
		#anglesr = {'right_e0': 0.0, 'right_e1': 0.0, 'right_w0': 0.0, 'right_w1': 0.0, 'right_w2': 0.0}
		msg = SoundRequest()
		msg.sound = -3
		msg.command = 1
		msg.arg = 'Moving my right arm to the side'
		msg.arg2 = 'voice_kal_diphone'
		pub_audio.publish(msg)
		limbr.move_to_joint_positions(anglesr)       
	elif data.data == "left_arm_side":
		#anglesl = {'right_e0': 0.0, 'right_e1': 0.0, 'right_w0': 0.0, 'right_w1': 0.0, 'right_w2': 0.0}
		msg = SoundRequest()
		msg.sound = -3
		msg.command = 1
		msg.arg = 'Moving my left arm to the side'
		msg.arg2 = 'voice_kal_diphone'
		pub_audio.publish(msg)
		limbl.move_to_joint_positions(anglesl)
	elif data.data == "left_arm_side":
		#anglesr = {'right_e0': 0.0, 'right_e1': 0.0, 'right_w0': 0.0, 'right_w1': 0.0, 'right_w2': 0.0}
		#anglesl = {'right_e0': 0.0, 'right_e1': 0.0, 'right_w0': 0.0, 'right_w1': 0.0, 'right_w2': 0.0}
		msg = SoundRequest()
		msg.sound = -3
		msg.command = 1
		msg.arg = 'Moving both of my arms to the side'
		msg.arg2 = 'voice_kal_diphone'
		pub_audio.publish(msg)
		limbr.move_to_joint_positions(anglesr)
		limbl.move_to_joint_positions(anglesl)