Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError while running tables demo on simulation #49

Open
oscar-lima opened this issue Mar 28, 2024 · 5 comments
Open

AssertionError while running tables demo on simulation #49

oscar-lima opened this issue Mar 28, 2024 · 5 comments
Assignees

Comments

@oscar-lima
Copy link
Contributor

oscar@OLIMA-P15U:~ $ rosrun tables_demo_planning tables_demo_node.py
Traceback (most recent call last):
  File "/home/oscar/ros_ws/mobipick_labs_ws/devel/lib/tables_demo_planning/tables_demo_node.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/oscar/ros_ws/mobipick_labs_ws/src/mobipick_labs/tables_demo_planning/nodes/tables_demo_node.py", line 49, in <module>
    unified_planning.shortcuts.get_environment().credits_stream = None
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 159, in get_environment
    GLOBAL_ENVIRONMENT = Environment()
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 45, in __init__
    self._factory = unified_planning.engines.Factory(self)
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 214, in __init__
    self._add_engine(name, module_name, class_name)
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 402, in _add_engine
    module = importlib.import_module(module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/oscar/.local/lib/python3.8/site-packages/up_fmap/__init__.py", line 1, in <module>
    from .fmap_planner import FMAPsolver
  File "/home/oscar/.local/lib/python3.8/site-packages/up_fmap/fmap_planner.py", line 303, in <module>
    env = up.environment.get_environment()
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 159, in get_environment
    GLOBAL_ENVIRONMENT = Environment()
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 45, in __init__
    self._factory = unified_planning.engines.Factory(self)
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 221, in __init__
    self._add_meta_engine(
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 422, in _add_meta_engine
    if EngineImpl.is_compatible_engine(engine):
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/oversubscription_planner.py", line 59, in is_compatible_engine
    return engine.is_oneshot_planner() and engine.supports(ProblemKind({"ACTION_BASED", "NEGATIVE_CONDITIONS"}, version=LATEST_PROBLEM_KIND_VERSION))  # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/up_enhsp/enhsp_planner.py", line 80, in supports
    return problem_kind <= ENHSPEngine.supported_kind()
  File "/home/oscar/.local/lib/python3.8/site-packages/up_enhsp/enhsp_planner.py", line 67, in supported_kind
    supported_kind.set_conditions_kind('EQUALITY')  # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/model/problem_kind.py", line 159, in _set
    assert feature in possible_features, str(feature)
AssertionError: EQUALITY
@alexander-sung
Copy link
Contributor

alexander-sung commented Mar 28, 2024

pip list? Is your unified-planning up-to-date?

Okay, I just saw your other issue. 😄

@alexander-sung
Copy link
Contributor

As discussed, unfortunately, some planners are not providing all features as specified by UP. As a workaround, please deinstall up-fmap and up-enhsp.

@oscar-lima
Copy link
Contributor Author

Thanks, however after running:

pip3 uninstall up-fmap up-enhsp

a different error now shows:

Traceback (most recent call last):
  File "/home/oscar/ros_ws/mobipick_labs_ws/devel/lib/tables_demo_planning/tables_demo_node.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/oscar/ros_ws/mobipick_labs_ws/src/mobipick_labs/tables_demo_planning/nodes/tables_demo_node.py", line 49, in <module>
    unified_planning.shortcuts.get_environment().credits_stream = None
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 159, in get_environment
    GLOBAL_ENVIRONMENT = Environment()
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 45, in __init__
    self._factory = unified_planning.engines.Factory(self)
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 221, in __init__
    self._add_meta_engine(
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 422, in _add_meta_engine
    if EngineImpl.is_compatible_engine(engine):
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/oversubscription_planner.py", line 59, in is_compatible_engine
    return engine.is_oneshot_planner() and engine.supports(ProblemKind({"ACTION_BASED", "NEGATIVE_CONDITIONS"}, version=LATEST_PROBLEM_KIND_VERSION))  # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/up_tamer/engine.py", line 119, in supports
    return problem_kind <= EngineImpl.supported_kind()
  File "/home/oscar/.local/lib/python3.8/site-packages/up_tamer/engine.py", line 96, in supported_kind
    supported_kind.set_time('TIMED_EFFECT') # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/model/problem_kind.py", line 159, in _set
    assert feature in possible_features, str(feature)
AssertionError: TIMED_EFFECT

@alexander-sung
Copy link
Contributor

Same for up-tamer then, it seems, just for another feature. It's strange, though, I assumed tamer would work. If it still fails, what else does pip list lists for up-*?

@oscar-lima
Copy link
Contributor Author

after uninstalling up-tamer, up_lpg and up_aries it runs, here a full log for your reference:

oscar@OLIMA-P15U:scripts (mobipick) $ rosrun tables_demo_planning tables_demo_node.py
Traceback (most recent call last):
  File "/home/oscar/ros_ws/mobipick_labs_ws/devel/lib/tables_demo_planning/tables_demo_node.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/oscar/ros_ws/mobipick_labs_ws/src/mobipick_labs/tables_demo_planning/nodes/tables_demo_node.py", line 49, in <module>
    unified_planning.shortcuts.get_environment().credits_stream = None
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 159, in get_environment
    GLOBAL_ENVIRONMENT = Environment()
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 45, in __init__
    self._factory = unified_planning.engines.Factory(self)
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 221, in __init__
    self._add_meta_engine(
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 422, in _add_meta_engine
    if EngineImpl.is_compatible_engine(engine):
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/oversubscription_planner.py", line 59, in is_compatible_engine
    return engine.is_oneshot_planner() and engine.supports(ProblemKind({"ACTION_BASED", "NEGATIVE_CONDITIONS"}, version=LATEST_PROBLEM_KIND_VERSION))  # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/up_tamer/engine.py", line 119, in supports
    return problem_kind <= EngineImpl.supported_kind()
  File "/home/oscar/.local/lib/python3.8/site-packages/up_tamer/engine.py", line 96, in supported_kind
    supported_kind.set_time('TIMED_EFFECT') # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/model/problem_kind.py", line 159, in _set
    assert feature in possible_features, str(feature)
AssertionError: TIMED_EFFECT
oscar@OLIMA-P15U:scripts (mobipick) $ pip3 uninstall up-tamer
Found existing installation: up-tamer 0.3.1.13.dev1
Uninstalling up-tamer-0.3.1.13.dev1:
  Would remove:
    /home/oscar/.local/lib/python3.8/site-packages/up_tamer-0.3.1.13.dev1.dist-info/*
    /home/oscar/.local/lib/python3.8/site-packages/up_tamer/*
Proceed (Y/n)? y
  Successfully uninstalled up-tamer-0.3.1.13.dev1
oscar@OLIMA-P15U:scripts (mobipick) $ rosrun tables_demo_planning tables_demo_node.py
Traceback (most recent call last):
  File "/home/oscar/ros_ws/mobipick_labs_ws/devel/lib/tables_demo_planning/tables_demo_node.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/oscar/ros_ws/mobipick_labs_ws/src/mobipick_labs/tables_demo_planning/nodes/tables_demo_node.py", line 49, in <module>
    unified_planning.shortcuts.get_environment().credits_stream = None
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 159, in get_environment
    GLOBAL_ENVIRONMENT = Environment()
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 45, in __init__
    self._factory = unified_planning.engines.Factory(self)
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 221, in __init__
    self._add_meta_engine(
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 422, in _add_meta_engine
    if EngineImpl.is_compatible_engine(engine):
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/oversubscription_planner.py", line 59, in is_compatible_engine
    return engine.is_oneshot_planner() and engine.supports(ProblemKind({"ACTION_BASED", "NEGATIVE_CONDITIONS"}, version=LATEST_PROBLEM_KIND_VERSION))  # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/up_lpg/lpg_planner.py", line 106, in supports
    return problem_kind <= LPGEngine.supported_kind()
  File "/home/oscar/.local/lib/python3.8/site-packages/up_lpg/lpg_planner.py", line 95, in supported_kind
    supported_kind.set_conditions_kind('EQUALITY')  # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/model/problem_kind.py", line 159, in _set
    assert feature in possible_features, str(feature)
AssertionError: EQUALITY
oscar@OLIMA-P15U:scripts (mobipick) $ pip3 uninstall up_lpg
Found existing installation: up-lpg 0.0.6
Uninstalling up-lpg-0.0.6:
  Would remove:
    /home/oscar/.local/lib/python3.8/site-packages/up_lpg-0.0.6.dist-info/*
    /home/oscar/.local/lib/python3.8/site-packages/up_lpg/*
Proceed (Y/n)? y
  Successfully uninstalled up-lpg-0.0.6
oscar@OLIMA-P15U:scripts (mobipick) $ rosrun tables_demo_planning tables_demo_node.py
Traceback (most recent call last):
  File "/home/oscar/ros_ws/mobipick_labs_ws/devel/lib/tables_demo_planning/tables_demo_node.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/oscar/ros_ws/mobipick_labs_ws/src/mobipick_labs/tables_demo_planning/nodes/tables_demo_node.py", line 49, in <module>
    unified_planning.shortcuts.get_environment().credits_stream = None
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 159, in get_environment
    GLOBAL_ENVIRONMENT = Environment()
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/environment.py", line 45, in __init__
    self._factory = unified_planning.engines.Factory(self)
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 221, in __init__
    self._add_meta_engine(
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/factory.py", line 422, in _add_meta_engine
    if EngineImpl.is_compatible_engine(engine):
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/engines/oversubscription_planner.py", line 59, in is_compatible_engine
    return engine.is_oneshot_planner() and engine.supports(ProblemKind({"ACTION_BASED", "NEGATIVE_CONDITIONS"}, version=LATEST_PROBLEM_KIND_VERSION))  # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/up_aries/solver.py", line 200, in supports
    return problem_kind <= Aries.supported_kind()
  File "/home/oscar/.local/lib/python3.8/site-packages/up_aries/solver.py", line 175, in supported_kind
    supported_kind.set_time("TIMED_EFFECT")  # type: ignore
  File "/home/oscar/.local/lib/python3.8/site-packages/unified_planning/model/problem_kind.py", line 159, in _set
    assert feature in possible_features, str(feature)
AssertionError: TIMED_EFFECT
oscar@OLIMA-P15U:scripts (mobipick) $ pip3 uninstall up_aries
Found existing installation: up-aries 0.0.7
Uninstalling up-aries-0.0.7:
  Would remove:
    /home/oscar/.local/lib/python3.8/site-packages/up_aries-0.0.7.dist-info/*
    /home/oscar/.local/lib/python3.8/site-packages/up_aries/*
Proceed (Y/n)? y
  Successfully uninstalled up-aries-0.0.7
oscar@OLIMA-P15U:scripts (mobipick) $ rosrun tables_demo_planning tables_demo_node.py
[INFO] [/robot_api_916085]: waiting for move_group action server
[ INFO] [/move_group_commander_wrappers_1712046867690083661]: Loading robot model 'mobipick'...

after this, just normal log of the tables demo which runs fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants