robocup_knowledge
rgo2018/challenge_storing_groceries.py
Go to the documentation of this file.
1 # System
2 import math
3 
4 # ROS
5 import PyKDL as kdl
6 
7 # TU/e Robotics
8 from robot_skills.util.kdl_conversions import FrameStamped
9 from robocup_knowledge import knowledge_loader
10 from collections import namedtuple
11 
12 # Common knowledge
13 common = knowledge_loader.load_knowledge("common")
14 
15 # Detection
16 cabinet_amcl = ["cabinet", "storage_shelf"]
17 cabinet_poses = [FrameStamped(frame=kdl.Frame(kdl.Rotation.RPY(0.0, 0.0, 0), kdl.Vector(0.144, 3.274, 0.0)),
18  frame_id="map"),
19  FrameStamped(frame=kdl.Frame(kdl.Rotation.RPY(0.0, 0.0, math.pi), kdl.Vector(4.8, 2.5, 0.0)),
20  frame_id="map")]
21 object_shelves = ["shelf3", "shelf4", "shelf5"]
22 object_types = [obj["name"] for obj in common.objects]
23 
24 # Placing
25 default_place_entity = cabinet_amcl
26 
27 
28 """
29 EntityConfiguration defines a name, an pose estimate for the Entity and which volumes of that entity to use for
30 manipulation
31 """
32 EntityConfiguration = namedtuple("EntityConfiguration", ["entity_id", "pose_estimate", "manipulation_volumes"])
33 
34 """
35 A Workspace for Storing Groceries has EntityConfigurations for the two main entities in the challenge:
36 the grasp_entity (usually a table) and a place_entity (usually some cabinet or shelf).
37 Additionally, it defines in which room the challenge takes place
38 """
39 Workspace = namedtuple("Workspace", ["grasp_entity_conf", "place_entity_conf", "room"])
40 
41 cabinet_ws = Workspace(grasp_entity_conf=
42  EntityConfiguration(entity_id="dining_table",
43  pose_estimate=
44  FrameStamped(frame=kdl.Frame(kdl.Rotation.RPY(0.0, 0.0, math.pi),
45  kdl.Vector(2.447, 1.1695, 0.0)),
46  frame_id="map"),
47  manipulation_volumes=['on_top_of']
48  ),
49  place_entity_conf=
50  EntityConfiguration(entity_id="cabinet",
51  pose_estimate=FrameStamped(frame=kdl.Frame(kdl.Rotation.RPY(0.0, 0.0, 0),
52  kdl.Vector(0.144, 3.274, 0.0)),
53  frame_id="map"),
54  manipulation_volumes=['shelf2']
55  ),
56  room="dining_room")
57 
58 storage_shelf_ws = Workspace(
59  grasp_entity_conf=
60  EntityConfiguration(entity_id="dining_table",
61  pose_estimate=
62  FrameStamped(frame=kdl.Frame(kdl.Rotation.RPY(0.0, 0.0, math.pi),
63  kdl.Vector(2.447, 1.1695, 0.0)),
64  frame_id="map"),
65  manipulation_volumes=['on_top_of']
66  ),
67  place_entity_conf=
68  EntityConfiguration(entity_id="storage_shelf",
69  pose_estimate=
70  FrameStamped(frame=kdl.Frame(kdl.Rotation.RPY(0.0, 0.0, math.pi),
71  kdl.Vector(4.8, 2.5, 0.0)),
72  frame_id="map"),
73  manipulation_volumes=['shelf2']
74  ),
75  room="dining_room")
76 
77 bookcase_ws = Workspace(grasp_entity_conf=
78  EntityConfiguration(entity_id="cupboard",
79  pose_estimate=FrameStamped(
80  frame=kdl.Frame(kdl.Rotation.RPY(
81  0.0, 0.0,
82  math.pi/2), # right of shelf
83  # -math.pi/2), # left of shelf
84  kdl.Vector(8.5, 1.15, 0.0)), # right of shelf
85  # kdl.Vector(8.5, 3.15, 0.0)), # left of shelf
86  frame_id="map"),
87  manipulation_volumes=['on_top_of']
88  ),
89  place_entity_conf=
90  EntityConfiguration(entity_id="bookcase",
91  pose_estimate=FrameStamped(
92  frame=kdl.Frame(kdl.Rotation.RPY(0.0, 0.0, math.pi),
93  kdl.Vector(9.7, 2.0, 0.0)),
94  frame_id="map"),
95  manipulation_volumes=['shelf2']
96  ),
97  room="bedroom")
98 
99 workspaces = [cabinet_ws, storage_shelf_ws, bookcase_ws]
100 
101 
challenge_storing_groceries.EntityConfiguration
EntityConfiguration
Definition: rgo2018/challenge_storing_groceries.py:32
challenge_storing_groceries.Workspace
Workspace
Definition: rgo2018/challenge_storing_groceries.py:39