diff --git a/src/pycram/world_concepts/world_object.py b/src/pycram/world_concepts/world_object.py index 158caec32..d6274cf7e 100644 --- a/src/pycram/world_concepts/world_object.py +++ b/src/pycram/world_concepts/world_object.py @@ -739,8 +739,11 @@ def attach_not_attached_objects(self, attachments: Dict[Object, Attachment]) -> self.detach(obj) else: continue - self.attach(obj, attachment.parent_link.name, attachment.child_link.name, - attachment.bidirectional) + if attachment.loose: + obj.attach(self, attachment.child_link.name, attachment.parent_link.name, attachment.bidirectional) + else: + self.attach(obj, attachment.parent_link.name, attachment.child_link.name, + attachment.bidirectional) @property def link_states(self) -> Dict[int, LinkState]: diff --git a/test/bullet_world_testcase.py b/test/bullet_world_testcase.py index 54a48922e..7e572500b 100644 --- a/test/bullet_world_testcase.py +++ b/test/bullet_world_testcase.py @@ -2,6 +2,7 @@ import unittest import pycram.tasktree +from pycram.datastructures.world import UseProspectionWorld from pycram.worlds.bullet_world import BulletWorld from pycram.world_concepts.world_object import Object from pycram.datastructures.pose import Pose @@ -36,6 +37,8 @@ def setUpClass(cls): def setUp(self): self.world.reset_world() + with UseProspectionWorld(): + pass # DO NOT WRITE TESTS HERE!!! # Test related to the BulletWorld should be written in test_bullet_world.py @@ -45,6 +48,8 @@ def tearDown(self): pycram.tasktree.reset_tree() time.sleep(0.05) self.world.reset_world() + with UseProspectionWorld(): + pass @classmethod def tearDownClass(cls):