Skip to content

Commit

Permalink
Merge pull request #256 from sunava/semantic_representation
Browse files Browse the repository at this point in the history
Semantic representation
  • Loading branch information
sunava authored Jan 16, 2025
2 parents 5b19d11 + 07da82a commit 6e5afe7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/pycram/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,22 @@ def find_multiverse_path() -> Optional[str]:
return multiverse_path + multiverse_relative_path


def perform(action_instance):
"""
Executes the perform logic for a given action instance.
:param action_instance: An instance of an action class.
"""
if hasattr(action_instance, 'execute'):
return action_instance.execute()
raise AttributeError(f"{action_instance.__class__.__name__} has no 'plan' method.")


def an(designator):
"""
Resolve the first available action from the designator.
:param designator: The designator description instance.
:return: The first resolved action instance.
"""
return designator.resolve()

0 comments on commit 6e5afe7

Please sign in to comment.