Skip to content

Commit 999f137

Browse files
GustavoDCCIasonTheodorou
authored andcommitted
Fix data type process answer
1 parent 696a1c5 commit 999f137

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

robot_smach_states/src/robot_smach_states/human_interaction/human_interaction.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,11 @@ def execute(self, userdata=None):
604604
def process_answer(_, context: Union[ds.Designator, str], answer_des, output_des):
605605
try:
606606
answer_val = answer_des.resolve()
607-
context_val = context.resolve()
608607
rospy.logdebug(f"{answer_val=}")
609-
name = answer_val.semantics[f"{context_val}"]
608+
name = answer_val.semantics[context]
610609
rospy.loginfo(f"Your answer is: '{name}'")
611-
output_des.write(str(name))
610+
output_des.write(name)
611+
612612
except KeyError as e:
613613
rospy.loginfo(f"KeyError resolving the name heard: {e}")
614614
return "failed"
@@ -642,7 +642,7 @@ def __init__(self, robot, person_name_des, default_name="operator", nr_tries=2):
642642
)
643643
self.add(
644644
"HEAR",
645-
HearOptionsExtraPicoVoice(robot, "receptionist", answer.writeable, "personName"),
645+
HearOptionsExtraPicoVoice(robot, "receptionist", answer.writeable, ["personName"]),
646646
transitions={"heard": "PROCESS_ANSWER", "no_result": "CHECK_TRIES"},
647647
)
648648
self.add(

0 commit comments

Comments
 (0)