Commit 1d3d4051 authored by Patrick Holthaus's avatar Patrick Holthaus

use sound path in experiment script too

parent ce2b100f
......@@ -32,7 +32,9 @@
<!--<node name="popup_gui" pkg="safety_security" type="popup_gui" />-->
<!-- experiment routine that is triggered by inputs (e.g. experiment interface, button presses on the robot -->
<node name="experiment_flow" pkg="safety_security" type="experiment_$(arg robot).py" />
<node name="experiment_flow" pkg="safety_security" type="experiment_$(arg robot).py">
<param name="sound_path" value="/home/fetch/Sounds" />
</node>
<!-- website that pepper displays -->
<node name="pepper_display" pkg="safety_security" type="ws.py" />
......
......@@ -125,6 +125,7 @@ class ExperimentControl(object):
self.notify_pub = rospy.Publisher('/safety_security/notify', PopupMsg, queue_size=1)
self.cmd_pub = rospy.Publisher('/safety_security/cmd', String, queue_size=1)
self.actuators = Actuators()
self.sound_path = rospy.get_param("~sound_path", "/tmp")
def _callback(self, msgdata):
cmd = msgdata.data
......@@ -144,12 +145,13 @@ class ExperimentControl(object):
if not phrase is None:
#utterance = get_parameter("/script_server/utterances/" + phrase + "/", self.condition)
#self.sound.say(utterance)
self.sound.playWave(phrase + "/" + self.condition + ".ogg")
self.sound.playWave(self.sound_path + "/" + phrase + "/" + self.condition + ".ogg")
time.sleep(wait)
elif not self.acted is None:
#utterance = get_parameter("/script_server/utterances/" + self.acted + "/", self.condition)
#self.sound.say(utterance)
self.sound.playWave(self.acted + "/" + self.condition + ".ogg")
self.sound.playWave(self.sound_path + "/" + self.acted + "/" + self.condition + ".ogg")
time.sleep(wait)
rospy.loginfo("EXPERIMENT PHASE ID '%s', COND '%s': PUZZLE/INSPECT(%s).", self.experiment_id, self.condition, item)
......@@ -216,7 +218,7 @@ class ExperimentControl(object):
self.check_result(self.base.goto("greet" + "/" + self.condition), "base")
#utterance = get_parameter("/script_server/utterances/greeting/", self.condition)
#self.sound.say(utterance)
self.sound.playWave("greeting/" + self.condition + ".ogg")
self.sound.playWave(self.sound_path + "/greeting/" + self.condition + ".ogg")
#self.display(utterance, "EXPERIMENT READY", "Press <strong>Okay</strong> when ready", "Okay")
#self.sss.move("arm_right", "hello") #TODO decide
......@@ -242,10 +244,10 @@ class ExperimentControl(object):
#self.display(utterance)
#self.sound.say(int_utterance)
self.sound.playWave("interrupt/" + self.condition + ".ogg")
self.sound.playWave(self.sound_path + "/interrupt/" + self.condition + ".ogg")
time.sleep(2)
#self.sound.say(utterance)
self.sound.playWave(item + "/" + self.condition + ".ogg")
self.sound.playWave(self.sound_path + "/" + item + "/" + self.condition + ".ogg")
self.set_state("INTERRUPT/INFORMED(%s)" % item)
thread = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment