MCPcopy Create free account
hub / github.com/Gabesarch/ICAL / open

Method open

TEACh/models/agent/api_primitives_executable.py:363–388  ·  view source on GitHub ↗

Opens the interaction object. Note: Assumes object is closed and agent is at its location. Objects like fridges, cabinets, drawers can be opened. Returns: bool: True if action successful, otherwise False.

(self)

Source from the content-addressed store, hash-verified

361 return success
362
363 def open(self) -> None:
364 """
365 Opens the interaction object.
366
367 Note:
368 Assumes object is closed and agent is at its location.
369 Objects like fridges, cabinets, drawers can be opened.
370
371 Returns:
372 bool: True if action successful, otherwise False.
373 """
374 if self.object_id is None:
375 self.agent.step_success = False
376 return False
377 if self.object_class not in self.agent.OPENABLE_OBJECTS:
378 self.agent.step_success = False
379 return False
380 if self.check_attribute("open", True):
381 # pre-condition check: already open?
382 return True
383 if not self.agent.navigate_obj_info["obj_ID"]==self.object_id:
384 # pre-condition: make sure looking at object
385 self.go_to()
386 if self.check_attribute("toggled", True):
387 self.toggle_off()
388 return self.execute_manipulation("Open")
389
390 def close(self) -> None:
391 """

Callers 2

mainFunction · 0.45
placeMethod · 0.45

Calls 4

check_attributeMethod · 0.95
go_toMethod · 0.95
toggle_offMethod · 0.95
execute_manipulationMethod · 0.95

Tested by 1

mainFunction · 0.36