Slices the object into pieces, assuming the agent is holding a knife and is at the object's location. Returns: bool: True if action successful, otherwise False.
(self)
| 259 | return success_place |
| 260 | |
| 261 | def slice(self) -> None: |
| 262 | """ |
| 263 | Slices the object into pieces, assuming the agent is holding a knife and is at the object's location. |
| 264 | |
| 265 | Returns: |
| 266 | bool: True if action successful, otherwise False. |
| 267 | """ |
| 268 | if self.object_id is None: |
| 269 | self.agent.step_success = False |
| 270 | return False |
| 271 | if self.object_class not in self.agent.SLICEABLE: |
| 272 | self.agent.step_success = False |
| 273 | return False |
| 274 | if self.check_attribute("sliced", True): |
| 275 | # pre-condition check: already sliced? |
| 276 | return True |
| 277 | if not self.agent.object_tracker.get_label_of_holding() in ["Knife", "ButterKnife"]: |
| 278 | # pre-condition: make sure holding knife |
| 279 | self.agent.pickup_category("Knife") |
| 280 | if not self.agent.navigate_obj_info["obj_ID"]==self.object_id: |
| 281 | # pre-condition: make sure looking at object |
| 282 | self.go_to() |
| 283 | return self.execute_manipulation("Slice") |
| 284 | |
| 285 | def toggle_on(self) -> None: |
| 286 | """ |
nothing calls this directly
no test coverage detected