Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:cram2/pycram into jupyter-books
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigul committed Jul 23, 2024
2 parents 9d08bea + ab9b5ce commit 113df26
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/reusable-sphinx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
- name: Checkout 🛎
uses: actions/checkout@v3

- name: Install PyCRAM dependencies 🍼
uses: py-actions/py-dependency-install@v4
with:
path: "requirements-setuptools.txt"

# ----------------------------------------------------------------------------------------------------------------

- name: Install PyCRAM dependencies 🍼
Expand Down
12 changes: 6 additions & 6 deletions demos/pycram_bullet_world_demo/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def move_and_detect(obj_type):

milk_desig = move_and_detect(ObjectType.MILK)

TransportAction(milk_desig, ["left"], [Pose([4.8, 3.55, 0.8])]).resolve().perform()
TransportAction(milk_desig, [Arms.LEFT], [Pose([4.8, 3.55, 0.8])]).resolve().perform()

cereal_desig = move_and_detect(ObjectType.BREAKFAST_CEREAL)

TransportAction(cereal_desig, ["right"], [Pose([5.2, 3.4, 0.8], [0, 0, 1, 1])]).resolve().perform()
TransportAction(cereal_desig, [Arms.RIGHT], [Pose([5.2, 3.4, 0.8], [0, 0, 1, 1])]).resolve().perform()

bowl_desig = move_and_detect(ObjectType.BOWL)

TransportAction(bowl_desig, ["left"], [Pose([5, 3.3, 0.8], [0, 0, 1, 1])]).resolve().perform()
TransportAction(bowl_desig, [Arms.LEFT], [Pose([5, 3.3, 0.8], [0, 0, 1, 1])]).resolve().perform()

# Finding and navigating to the drawer holding the spoon
handle_desig = ObjectPart(names=["handle_cab10_t"], part_of=apartment_desig.resolve())
Expand All @@ -74,10 +74,10 @@ def move_and_detect(obj_type):

spoon_desig = DetectAction(BelieveObject(types=[ObjectType.SPOON])).resolve().perform()

pickup_arm = "left" if drawer_open_loc.arms[0] == "right" else "right"
PickUpAction(spoon_desig, [pickup_arm], ["top"]).resolve().perform()
pickup_arm = Arms.LEFT if drawer_open_loc.arms[0] == Arms.RIGHT else Arms.RIGHT
PickUpAction(spoon_desig, [pickup_arm], [Grasp.TOP]).resolve().perform()

ParkArmsAction([Arms.LEFT if pickup_arm == "left" else Arms.RIGHT]).resolve().perform()
ParkArmsAction([Arms.LEFT if pickup_arm == Arms.LEFT else Arms.RIGHT]).resolve().perform()

CloseAction(object_designator_description=handle_desig, arms=[drawer_open_loc.arms[0]]).resolve().perform()

Expand Down
2 changes: 1 addition & 1 deletion requirements-setuptools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ importlib_metadata>=6
tomli>=2.0.1
wheel>=0.43.0

# pkg_resources

platformdirs >= 2.6.2
2 changes: 2 additions & 0 deletions src/pycram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@
ch.setFormatter(formatter)

#from .specialized_designators import *

__version__ = "0.0.2"
4 changes: 2 additions & 2 deletions src/pycram/robot_descriptions/pr2_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
'r_gripper_r_finger_joint': 0.548})
right_gripper.add_static_joint_states(GripperState.CLOSE, {'r_gripper_l_finger_joint': 0.0,
'r_gripper_r_finger_joint': 0.0})
left_gripper.end_effector_type = GripperType.PARALLEL
left_gripper.opening_distance = 0.548
right_gripper.end_effector_type = GripperType.PARALLEL
right_gripper.opening_distance = 0.548
right_arm.end_effector = right_gripper


Expand Down

0 comments on commit 113df26

Please sign in to comment.