Skip to content

Commit

Permalink
Merge pull request #226 from AbdelrhmanBassiouny/giskard_fallschool_c…
Browse files Browse the repository at this point in the history
…hanges

Giskard fallschool changes
  • Loading branch information
Tigul authored Dec 4, 2024
2 parents 0250d46 + be45a41 commit 3f17584
Show file tree
Hide file tree
Showing 21 changed files with 260 additions and 98 deletions.
3 changes: 3 additions & 0 deletions config/multiverse_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ class MultiverseConfig(WorldConfig):

position_tolerance = 2e-2
prismatic_joint_position_tolerance = 2e-2

use_giskard_monitor = False
allow_gripper_collision = False
11 changes: 11 additions & 0 deletions config/world_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ class WorldConfig:
"""
Whether to raise an error if the goals are not achieved.
"""

use_giskard_monitor: bool = True
"""
Whether to use the Giskard goal monitor when executing the goals.
"""

allow_gripper_collision: bool = True
"""
Whether to allow the gripper to collide with the objects when planning for the goals.
"""

@classmethod
def get_pose_tolerance(cls) -> Tuple[float, float]:
return cls.position_tolerance, cls.orientation_tolerance
Empty file.
29 changes: 28 additions & 1 deletion doc/source/orm.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# ORM
# ORM

When adding parameters to the Actions/Motions, you need to add those in the ORM classes as well.
Make sure to set "init=False" and "default=default_value" in the mapped_column if the added parameter is not a required
parameter.

Example:

```python
class Action():

new_parameter: float = 0.0

class ActionORM(Base):

new_parameter: Mapped[float] = mapped_column(init=False, default=0.0)
```

When modifying an action by adding another action/motion as part of it make sure to modify the position_results assertion
in test_node in the test_orm.py and test_simulated_tree, test_tree_creation in test_task_tree.py accordingly. A helpful tecnique is to print the task_tree and count the poses,
so each action has at least one pose since it has a robot_state unlike motions, then you add the poses that are needed
in that action:
```python
root = pycram.tasktree.task_tree.root
print(RenderTree(root, style=AsciiStyle()))
```

Or you could just print the len(position_results) and use that number to modify the assertion.
7 changes: 4 additions & 3 deletions examples/cram_plan_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ def plan(obj, obj_desig, torso=0.2, place="countertop"):
location = CostmapLocation(target=obj_desig, reachable_for=robot_desig)
pose = location.resolve()
print()
NavigateActionPerformable(pose.pose).perform()
NavigateActionPerformable(pose.pose, True).perform()
ParkArmsActionPerformable(Arms.BOTH).perform()
good_torsos.append(torso)
picked_up_arm = pose.reachable_arms[0]
PickUpActionPerformable(object_designator=obj_desig, arm=pose.reachable_arms[0], grasp=Grasp.FRONT).perform()
PickUpActionPerformable(object_designator=obj_desig, arm=pose.reachable_arms[0], grasp=Grasp.FRONT,
prepose_distance=0.03).perform()

ParkArmsActionPerformable(Arms.BOTH).perform()
scm = SemanticCostmapLocation(place, apartment_desig, obj_desig)
Expand All @@ -171,7 +172,7 @@ def plan(obj, obj_desig, torso=0.2, place="countertop"):
reachable_arm=picked_up_arm)
pose = place_location.resolve()

NavigateActionPerformable(pose.pose).perform()
NavigateActionPerformable(pose.pose, True).perform()

PlaceActionPerformable(object_designator=obj_desig, target_location=pose_island.pose,
arm=picked_up_arm).perform()
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_notebook_examples.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
source /opt/ros/noetic/setup.bash
source ~/catkin_ws/devel/setup.bash
source ~/cram_ws/devel/setup.bash
roscd pycram/examples
rm -rf tmp
mkdir tmp
Expand Down
10 changes: 10 additions & 0 deletions src/pycram/datastructures/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ class MJCFJointType(Enum):
FIXED = "fixed" # Added for compatibility with PyCRAM, but not a real joint type in MuJoCo.


class MovementType(Enum):
"""
Enum for the different movement types of the robot.
"""
STRAIGHT_TRANSLATION = auto()
STRAIGHT_CARTESIAN = auto()
TRANSLATION = auto()
CARTESIAN = auto()


class MultiverseAPIName(Enum):
"""
Enum for the different APIs of the Multiverse.
Expand Down
Loading

0 comments on commit 3f17584

Please sign in to comment.