Skip to content

Commit

Permalink
Receptionist Fix (#249)
Browse files Browse the repository at this point in the history
Co-authored-by: Zoe <[email protected]>
  • Loading branch information
haiwei-luo and zoe013evans authored Jul 8, 2024
1 parent 8e76f9f commit eaac626
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 39 deletions.
57 changes: 57 additions & 0 deletions tasks/receptionist/config/6_floor_k.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
priors:
names:
- Adel
- Angel
- Axel
- Charlie
- Jane
- Jules
- Morgan
- Paris
- Robin
- Simone
drinks:
- cola
- iced tea
- juice pack
- milk
- orange juice
- red wine
- tropical juice

# WAIT POSE KITCHEN:
wait_pose:
position:
x: 8.245934441303595
y: 24.285935396834816
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.08719394681831685
w: 0.9961913549304895

# WAIT AREA KITCHEN:
wait_area: [[9.16, 25.3], [10.6, 25.7], [11, 24.1], [9.4, 23.7]]

seat_pose:
position:
x: 7.439730848846352
y: 22.667057212175145
z: 0.0
orientation:
x: 0.0
y: 0.0
z: -0.6336387580418182
w: 0.7736290611832146

search_motions: ["look_left", "look_right"]
sofa_point:
x: 7.78
y: 20.1
z: 0.5
seat_area: [[10.8, 20.2], [5.2, 18.9], [4.41, 21.6], [10.1, 23.1]]
max_people_on_sofa: 2
sofa_area: [[8.52, 20.1], [7.1, 19.8], [6.71, 21.1], [8.06, 21.5]]

sweep: true
54 changes: 27 additions & 27 deletions tasks/receptionist/config/lab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,52 @@ priors:
- orange juice
- red wine
- tropical juice
# wait_pose:
# position:
# x: 2.4307581363168773
# y: -1.661594410669659
# z: 0.0
# orientation:
# x: 0.0
# y: 0.0
# z: 0.012769969339563213
# w: 0.9999184606171978


#WAIT POSE LAB:
wait_pose:
position:
x: 8.245934441303595
y: 24.285935396834816
x: 2.4307581363168773
y: -1.661594410669659
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.08719394681831685
w: 0.9961913549304895
z: 0.012769969339563213
w: 0.9999184606171978

#556918144226074


#0.478893309417269
#0.8778731105321406

# wait_area: [[2.65, -0.61], [4.21, -0.33], [4.58, -2.27], [2.67, -2.66]]
wait_area: [[9.16, 25.3], [10.6, 25.7], [11, 24.1], [9.4, 23.7]]

#WAIT AREA LAB:
# From robot POV: [top left, top right,bottom right, bottom left ]
wait_area: [[2.65, -0.61], [4.21, -0.33], [4.58, -2.27], [2.67, -2.66]]

#Where to position self for seating guests
seat_pose:
position:
x: 7.439730848846352
y: 22.667057212175145
x: 1.10349540659
y: 0.17802904565
z: 0.0
orientation:
x: 0.0
y: 0.0
z: -0.6336387580418182
w: 0.7736290611832146
z: 0.816644293927375
w: 0.577141314753899


search_motions: ["look_left", "look_right"]
sofa_point:
x: 7.78
y: 20.1
z: 0.5
seat_area: [[10.8, 20.2], [5.2, 18.9], [4.41, 21.6], [10.1, 23.1]]
max_people_on_sofa: 2
sofa_area: [[8.52, 20.1], [7.1, 19.8], [6.71, 21.1], [8.06, 21.5]]
sofa_point:
x: 0.4604474902153015
y: 1.877323865890503
z: 0.002471923828125

seat_area: [[-0.39, 0.87], [-0.74, 2.18], [1.26, 2.64], [1.54, 1.26]]
max_people_on_sofa: 0
sofa_area: [[-0.39, 0.87], [-0.74, 2.18], [1.26, 2.64], [1.54, 1.26]]

sweep: true
61 changes: 61 additions & 0 deletions tasks/receptionist/config/year_10_demo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
priors:
names:
- Adel
- Angel
- Axel
- Charlie
- Jane
- Jules
- Morgan
- Paris
- Robin
- Simone
drinks:
- cola
- iced tea
- juice pack
- milk
- orange juice
- red wine
- tropical juice

# WAIT POSE YEAR 10 DEMO:
wait_pose:
position:
x: 2.675762687658822
y: 2.3335752842925213
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.77370619167885
w: 0.6335445753518931

# WAIT AREA YEAR 10 DEMO:
# From robot POV: [top left, top right,bottom right, bottom left ]
wait_area: [[1.26,4.6],[2.80,4.82],[3.03,3.63],[1.53,3.4]]

#Where to position self for seating guests
seat_pose:
position:
x: 1.10349540659
y: 0.17802904565
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.816644293927375
w: 0.577141314753899


search_motions: ["look_left", "look_right"]
sofa_point:
x: 0.4604474902153015
y: 1.877323865890503
z: 0.002471923828125
seat_area: [[-0.39, 0.87], [-0.74, 2.18], [1.26, 2.64], [1.54, 1.26]]
max_people_on_sofa: 0
#sofa_area: [[-0.39, 0.87], [-0.74, 2.18], [1.26, 2.64], [1.54, 1.26]]
sofa_area: [[0.83, 2.40], [1.16, 2.51], [1.23, 2.27], [0.91, 2.17]]

sweep: true
2 changes: 1 addition & 1 deletion tasks/receptionist/launch/setup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<include file="$(find lasr_vision_yolov8)/launch/service.launch"/>
<include file="$(find lasr_vision_cropped_detection)/launch/cropped_detection.launch"/>
<node pkg="lasr_vision_feature_extraction" type="service" name="torch_service" output="screen"/>
<include file="$(find lasr_vision_bodypix)/launch/bodypix_services.launch">
<include file="$(find lasr_vision_bodypix)/launch/bodypix.launch">
<param name="preload" type="yaml" value='resnet50' />
</include>

Expand Down
25 changes: 14 additions & 11 deletions tasks/receptionist/src/receptionist/states/speech_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _handle_name(self, sentence_list, last_resort):
return self._handle_closest_spelt(sentence_list, self._available_names)

def _handle_drink(self, sentence_list, last_resort):
result = self._infer_second_drink(sentence_list)
result = self._infer_second_drink(sentence_list, last_resort)
if result != "unknown":
return result
result = self._handle_similar_spelt(sentence_list, self._available_drinks, 1)
Expand All @@ -150,7 +150,7 @@ def _handle_drink(self, sentence_list, last_resort):
return result
else:
sentence_list.append(result)
return self._infer_second_drink(sentence_list)
return self._infer_second_drink(sentence_list, last_resort)
else:
if not last_resort:
return "unknown"
Expand All @@ -164,7 +164,7 @@ def _handle_drink(self, sentence_list, last_resort):
return closest_spelt
else:
sentence_list.append(closest_spelt)
return self._infer_second_drink(closest_spelt)
return self._infer_second_drink(closest_spelt, last_resort)

def _handle_similar_spelt(self, sentence_list, available_words, distance_threshold):
for input_word in sentence_list:
Expand All @@ -187,17 +187,20 @@ def _handle_similar_sound(self, sentence_list, available_words, distance_thresho
return available_word
return "unknown"

def _infer_second_drink(self, sentence_list):
def _infer_second_drink(self, sentence_list, recover_juice=False):
for input_word in sentence_list:
if input_word == "juice":
choices = ["pack", "orange", "tropical"]
closest_word = self._handle_closest_spelt(sentence_list, choices)
if closest_word == "pack":
return "juice pack"
elif closest_word == "orange":
return "orange juice"
if recover_juice:
choices = ["pack", "orange", "tropical"]
closest_word = self._handle_closest_spelt(sentence_list, choices)
if closest_word == "pack":
return "juice pack"
elif closest_word == "orange":
return "orange juice"
else:
return "tropical juice"
else:
return "tropical juice"
return "unknown"
for available_word in self._available_double_drinks:
if input_word == available_word:
return self._double_drinks_dict[input_word]
Expand Down

0 comments on commit eaac626

Please sign in to comment.