Skip to content

Commit

Permalink
[PhysicalObject] corrections after rebasing on dev.
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrhmanBassiouny committed Dec 13, 2024
1 parent 2333eda commit 9403bcd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
8 changes: 1 addition & 7 deletions src/pycram/designators/action_designator.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,7 @@ def plan(self) -> None:
for pose in pickup_loc:
if self.arm in pose.reachable_arms:
pickup_pose = pose
NavigateActionPerformable(pickup_pose.pose).perform()
robot = robot_desig.resolve().world_object
if robot.pose.almost_equal(pickup_pose.pose, 0.1, 3):
break
else:
pickup_pose = None
continue
break
if not pickup_pose:
raise ObjectUnfetchable(
f"Found no pose for the robot to grasp the object: {self.object_designator} with arm: {self.arm}")
Expand Down
2 changes: 1 addition & 1 deletion src/pycram/process_modules/pr2_process_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
try:
from ..worlds import Multiverse
except ImportError:
Multiverse = NoneType
Multiverse = type(None)

try:
from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2
Expand Down
8 changes: 4 additions & 4 deletions src/pycram/worlds/multiverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,22 @@ class Multiverse(World):
Add the MJCF description extension to the extension to description type mapping for the objects.
"""

def __init__(self, is_prospection_world: Optional[bool] = False,
def __init__(self, is_prospection: Optional[bool] = False,
clear_cache: bool = False):
"""
Initialize the Multiverse Socket and the PyCram World.
:param is_prospection_world: Whether the world is prospection or not.
:param is_prospection: Whether the world is prospection or not.
:param clear_cache: Whether to clear the cache or not.
"""

self.latest_save_id: Optional[int] = None
self.saved_simulator_states: Dict = {}
self.make_sure_multiverse_resources_are_added(clear_cache=clear_cache)

self.simulation = self.conf.prospection_world_prefix if is_prospection_world else "belief_state"
self.simulation = self.conf.prospection_world_prefix if is_prospection else "belief_state"
self.client_manager = MultiverseClientManager(self.conf.simulation_wait_time_factor)
self._init_clients(is_prospection=is_prospection_world)
self._init_clients(is_prospection=is_prospection)

World.__init__(self, mode=WorldMode.DIRECT, is_prospection=is_prospection)

Expand Down
8 changes: 4 additions & 4 deletions test/test_task_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def test_tree_creation(self):
# self.tearDownBulletWorld()
tt = pycram.tasktree.task_tree

self.assertEqual(16, len(tt.root))
self.assertEqual(11, len(tt.root.leaves))
self.assertEqual(15, len(tt.root))
self.assertEqual(10, len(tt.root.leaves))

# check that all nodes succeeded
for node in anytree.PreOrderIter(tt.root):
Expand Down Expand Up @@ -74,8 +74,8 @@ def test_simulated_tree(self):
self.plan()
tt = pycram.tasktree.task_tree

self.assertEqual(16, len(tt.root))
self.assertEqual(11, len(tt.root.leaves))
self.assertEqual(15, len(tt.root))
self.assertEqual(10, len(tt.root.leaves))

self.assertEqual(len(pycram.tasktree.task_tree), 1)

Expand Down

0 comments on commit 9403bcd

Please sign in to comment.