diff --git a/requirements-resolver.txt b/requirements-resolver.txt index 0425b4650..4eb2a63a3 100644 --- a/requirements-resolver.txt +++ b/requirements-resolver.txt @@ -1,4 +1,3 @@ -r requirements.txt probabilistic_model>=4.0.8 random_events>=2.0.9 -tqdm diff --git a/src/pycram/datastructures/dataclasses.py b/src/pycram/datastructures/dataclasses.py index a97abda86..d83bcd00f 100644 --- a/src/pycram/datastructures/dataclasses.py +++ b/src/pycram/datastructures/dataclasses.py @@ -2,8 +2,8 @@ from dataclasses import dataclass from typing_extensions import List, Optional, Tuple, Callable, Dict, Any, Union, TYPE_CHECKING -from .datastructures.enums import JointType, Shape -from .datastructures.pose import Pose, Point +from .enums import JointType, Shape +from .pose import Pose, Point from abc import ABC, abstractmethod if TYPE_CHECKING: diff --git a/src/pycram/datastructures/local_transformer.py b/src/pycram/datastructures/local_transformer.py index e045d0148..87a87003f 100644 --- a/src/pycram/datastructures/local_transformer.py +++ b/src/pycram/datastructures/local_transformer.py @@ -9,7 +9,7 @@ from rospy import Duration from geometry_msgs.msg import TransformStamped -from .datastructures.pose import Pose, Transform +from .pose import Pose, Transform from typing_extensions import List, Optional, Union, Iterable diff --git a/test/test_cache_manager.py b/test/test_cache_manager.py index 0a4ac8524..bad803f22 100644 --- a/test/test_cache_manager.py +++ b/test/test_cache_manager.py @@ -3,13 +3,15 @@ from bullet_world_testcase import BulletWorldTestCase from pycram.datastructures.enums import ObjectType from pycram.world_concepts.world_object import Object +import pathlib class TestCacheManager(BulletWorldTestCase): def test_generate_description_and_write_to_cache(self): cache_manager = self.world.cache_manager - path = "../resources/apartment.urdf" + file_path = pathlib.Path(__file__).parent.resolve() + path = str(file_path) + "/../resources/apartment.urdf" extension = Path(path).suffix cache_path = self.world.cache_dir + "apartment.urdf" apartment = Object("apartment", ObjectType.ENVIRONMENT, path) diff --git a/test/test_description.py b/test/test_description.py index e1c62ccbf..a0d12b3b2 100644 --- a/test/test_description.py +++ b/test/test_description.py @@ -1,3 +1,5 @@ +import pathlib + from bullet_world_testcase import BulletWorldTestCase @@ -19,9 +21,11 @@ def test_joint_child_link(self): self.assertEqual(self.robot.get_joint_parent_link("base_footprint_joint"), self.robot.root_link) def test_generate_description_from_mesh(self): - self.assertTrue(self.milk.description.generate_description_from_file("../resources/cached/milk.stl", + file_path = pathlib.Path(__file__).parent.resolve() + self.assertTrue(self.milk.description.generate_description_from_file(str(file_path) + "/../resources/cached/milk.stl", "milk", ".stl")) def test_generate_description_from_description_file(self): - self.assertTrue(self.milk.description.generate_description_from_file("../resources/cached/milk.urdf", + file_path = pathlib.Path(__file__).parent.resolve() + self.assertTrue(self.milk.description.generate_description_from_file(str(file_path) + "/../resources/cached/milk.urdf", "milk", ".urdf")) diff --git a/test/test_object.py b/test/test_object.py index 5c71fc347..b024526c1 100644 --- a/test/test_object.py +++ b/test/test_object.py @@ -8,7 +8,7 @@ from pycram.world_concepts.world_object import Object from geometry_msgs.msg import Point, Quaternion - +import pathlib class TestObject(BulletWorldTestCase): @@ -17,7 +17,8 @@ def test_wrong_object_description_path(self): milk = Object("milk2", ObjectType.MILK, "wrong_path.sk") def test_malformed_object_description(self): - malformed_file = "../resources/cached/malformed_description.urdf" + file_path = pathlib.Path(__file__).parent.resolve() + malformed_file = str(file_path) + "/../resources/cached/malformed_description.urdf" with open(malformed_file, "w") as file: file.write("malformed") with self.assertRaises(Exception):