From efe3b583a66e5f76ddc657e7c382c8f6e26bd1f8 Mon Sep 17 00:00:00 2001 From: Abdelrhman Bassiouny Date: Tue, 8 Oct 2024 11:59:27 +0200 Subject: [PATCH] [MultiverseDev] changed how multiverse is searched for, and changed the way contact points list is printed. --- src/pycram/datastructures/dataclasses.py | 2 +- src/pycram/helper.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pycram/datastructures/dataclasses.py b/src/pycram/datastructures/dataclasses.py index 040189ce3..ddf5d7b21 100644 --- a/src/pycram/datastructures/dataclasses.py +++ b/src/pycram/datastructures/dataclasses.py @@ -603,7 +603,7 @@ def get_objects_that_have_points(self) -> List[Object]: return list({point.link_b.object for point in self}) def __str__(self): - return f"ContactPointsList: {', '.join(self.get_names_of_objects_that_have_points())}" + return f"ContactPointsList: {', '.join([point.__str__() for point in self])}" def __repr__(self): return self.__str__() diff --git a/src/pycram/helper.py b/src/pycram/helper.py index d3c39176e..c184c0c70 100644 --- a/src/pycram/helper.py +++ b/src/pycram/helper.py @@ -100,6 +100,7 @@ def find_multiverse_path() -> Optional[str]: """ # Get the value of PYTHONPATH environment variable pythonpath = os.getenv('PYTHONPATH') + multiverse_relative_path = "Multiverse/multiverse" # Check if PYTHONPATH is set if pythonpath: @@ -108,8 +109,8 @@ def find_multiverse_path() -> Optional[str]: # Iterate through each path and check if 'Multiverse' is in it for path in paths: - if 'multiverse' in path: - multiverse_path = path.split('multiverse')[0] - return multiverse_path + 'multiverse' + if multiverse_relative_path in path: + multiverse_path = path.split(multiverse_relative_path)[0] + return multiverse_path + multiverse_relative_path