@@ -134,9 +134,10 @@ def face_id(self) -> int:
134134
135135 import anki_vector
136136
137- # Print the visible face ids
138- for face in robot.world.visible_faces:
139- print(f"Visible id: {face.face_id}")
137+ with anki_vector.Robot(enable_face_detection=True) as robot:
138+ # Print the visible face ids
139+ for face in robot.world.visible_faces:
140+ print(f"Visible id: {face.face_id}")
140141 """
141142 return self ._face_id if self ._updated_face_id is None else self ._updated_face_id
142143
@@ -154,9 +155,9 @@ def has_updated_face_id(self) -> bool:
154155
155156 import anki_vector
156157
157- with anki_vector.Robot() as robot:
158- face = robot.world.get_face(1)
159- was_face_originally_unrecognized_but_is_now_recognized = face.has_updated_face_id
158+ with anki_vector.Robot(enable_face_detection=True ) as robot:
159+ for face in robot.world.visible_faces:
160+ was_face_originally_unrecognized_but_is_now_recognized = face.has_updated_face_id
160161 """
161162 return self ._updated_face_id is not None
162163
@@ -168,9 +169,9 @@ def updated_face_id(self) -> int:
168169
169170 import anki_vector
170171
171- with anki_vector.Robot() as robot:
172- face = robot.world.get_face(1)
173- updated_id = face.updated_face_id
172+ with anki_vector.Robot(enable_face_detection=True ) as robot:
173+ for face in robot.world.visible_faces:
174+ print(f"updated_face_id: { face.updated_face_id}")
174175 """
175176 if self ._updated_face_id :
176177 return self ._updated_face_id
@@ -186,9 +187,9 @@ def name(self) -> str:
186187
187188 import anki_vector
188189
189- with anki_vector.Robot() as robot:
190- face = robot.world.get_face(1)
191- name = face.name
190+ with anki_vector.Robot(enable_face_detection=True ) as robot:
191+ for face in robot.world.visible_faces:
192+ print(f"Face name: { face.name}")
192193 """
193194 return self ._name
194195
@@ -207,9 +208,9 @@ def expression(self) -> str:
207208
208209 import anki_vector
209210
210- with anki_vector.Robot() as robot:
211- face = robot.world.get_face(1)
212- expression = face.expression
211+ with anki_vector.Robot(enable_face_detection=True ) as robot:
212+ for face in robot.world.visible_faces:
213+ print(f"expression: { face.expression}")
213214 """
214215 return self ._expression
215216
@@ -225,9 +226,9 @@ def expression_score(self) -> List[int]:
225226
226227 import anki_vector
227228
228- with anki_vector.Robot() as robot:
229- face = robot.world.get_face(1)
230- expression_score = face.expression_score
229+ with anki_vector.Robot(enable_face_detection=True ) as robot:
230+ for face in robot.world.visible_faces:
231+ print(f"expression_score: { face.expression_score}")
231232 """
232233 return self ._expression_score
233234
@@ -239,9 +240,9 @@ def left_eye(self) -> List[protocol.CladPoint]:
239240
240241 import anki_vector
241242
242- with anki_vector.Robot() as robot:
243- face = robot.world.get_face(1)
244- left_eye = face.left_eye
243+ with anki_vector.Robot(enable_face_detection=True ) as robot:
244+ for face in robot.world.visible_faces:
245+ print(f"left_eye: { face.left_eye}")
245246 """
246247 return self ._left_eye
247248
@@ -253,9 +254,9 @@ def right_eye(self) -> List[protocol.CladPoint]:
253254
254255 import anki_vector
255256
256- with anki_vector.Robot() as robot:
257- face = robot.world.get_face(1)
258- right_eye = face.right_eye
257+ with anki_vector.Robot(enable_face_detection=True ) as robot:
258+ for face in robot.world.visible_faces:
259+ print(f"right_eye: { face.right_eye}")
259260 """
260261 return self ._right_eye
261262
@@ -267,9 +268,9 @@ def nose(self) -> List[protocol.CladPoint]:
267268
268269 import anki_vector
269270
270- with anki_vector.Robot() as robot:
271- face = robot.world.get_face(1)
272- nose = face.nose
271+ with anki_vector.Robot(enable_face_detection=True ) as robot:
272+ for face in robot.world.visible_faces:
273+ print(f"nose: { face.nose}")
273274 """
274275 return self ._nose
275276
@@ -281,9 +282,9 @@ def mouth(self) -> List[protocol.CladPoint]:
281282
282283 import anki_vector
283284
284- with anki_vector.Robot() as robot:
285- face = robot.world.get_face(1)
286- mouth = face.mouth
285+ with anki_vector.Robot(enable_face_detection=True ) as robot:
286+ for face in robot.world.visible_faces:
287+ print(f"mouth: { face.mouth}")
287288 """
288289 return self ._mouth
289290
@@ -332,6 +333,7 @@ async def request_enrolled_names(self) -> protocol.RequestEnrolledNamesRequest:
332333
333334 with anki_vector.Robot() as robot:
334335 name_data_list = robot.faces.request_enrolled_names()
336+ print(f"{name_data_list}")
335337 """
336338 req = protocol .RequestEnrolledNamesRequest ()
337339 return await self .grpc_interface .RequestEnrolledNames (req )
0 commit comments