Closes the interaction object. Note: Assumes object is open and agent is at its location. Objects like fridges, cabinets, drawers can be closed. Returns: bool: True if action successful, otherwise False.
(self)
| 388 | return self.execute_manipulation("Open") |
| 389 | |
| 390 | def close(self) -> None: |
| 391 | """ |
| 392 | Closes the interaction object. |
| 393 | |
| 394 | Note: |
| 395 | Assumes object is open and agent is at its location. |
| 396 | Objects like fridges, cabinets, drawers can be closed. |
| 397 | |
| 398 | Returns: |
| 399 | bool: True if action successful, otherwise False. |
| 400 | """ |
| 401 | if self.object_id is None: |
| 402 | self.agent.step_success = False |
| 403 | return False |
| 404 | if self.object_class not in self.agent.OPENABLE_OBJECTS: |
| 405 | self.agent.step_success = False |
| 406 | return False |
| 407 | if self.check_attribute("open", False): |
| 408 | # pre-condition check: already closed? |
| 409 | return True |
| 410 | if not self.agent.navigate_obj_info["obj_ID"]==self.object_id: |
| 411 | # pre-condition: make sure looking at object |
| 412 | self.go_to() |
| 413 | return self.execute_manipulation("Close") |
| 414 | |
| 415 | def put_down(self) -> None: |
| 416 | """ |
no test coverage detected