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

Method slice

TEACh/models/agent/api_primitives_executable.py:261–283  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

check_attributeMethod · 0.95
go_toMethod · 0.95
execute_manipulationMethod · 0.95
get_label_of_holdingMethod · 0.80
pickup_categoryMethod · 0.80

Tested by

no test coverage detected