Skip to content

Commit

Permalink
[MultiverseAction] made sure when setting attachments to obey the loo…
Browse files Browse the repository at this point in the history
…se such that the correct attachment is set.
  • Loading branch information
AbdelrhmanBassiouny committed Aug 6, 2024
1 parent fcd8526 commit 8def0da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pycram/world_concepts/world_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
5 changes: 5 additions & 0 deletions test/bullet_world_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit 8def0da

Please sign in to comment.