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)
| 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 | """ |