Skip to content

Commit

Permalink
[WorldObject] Added function which returns links to which something i…
Browse files Browse the repository at this point in the history
…s attached
  • Loading branch information
Tigul committed Aug 30, 2024
1 parent b020755 commit 7c6c14c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pycram/world_concepts/world_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,15 @@ def copy_to_prospection(self) -> Object:
obj.current_state = self.current_state
return obj

def get_link_for_attached_objects(self) -> Dict[Object, ObjectDescription.Link]:
"""
Returns a dictionary which maps attached object to the link of this object to which the given object is attached.
:return: The link of this object to which the given object is attached.
"""
return {obj: attachment.parent_link for obj, attachment in self.attachments.items()}


def __copy__(self) -> Object:
"""
Returns a copy of this object. The copy will have the same name, type, path, description, pose, world and color.
Expand Down

0 comments on commit 7c6c14c

Please sign in to comment.