forked from Chiba9/Irregular-Object-Packing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpseudo_code.txt
101 lines (52 loc) · 3.25 KB
/
pseudo_code.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
The main training loop iteratively performs the following steps:
For train_episode in range(5000)::
Initialize simulation
Load num_loaded_objects items
For i in range(num_loaded_objects)
If n_unpacked items == 0:
break
else:
Comupute heightmap of box
If no remaining space in the box:
break
else:
If stage_1:
Order remaining objects accoding to BBox volume
Select next object to be packed according to this order
If stage_2:
Order remaining objects accoding to BBox volume.
Select the K objects with highest BBox volume
Compute Heightmaps of the K objects (6 views) and concatenate with Box Heightmap
Run a forward pass through the Manager network to get SCORES for the next object to be packed.
Select next object to be packed according to this scores
For different (r,p,y) obtain heigthmaps of the remaining objects to be packed and concatenate with Box Heightmap
Runs a forward pass through the worker network to get SCORES for pos (X,Y) and ori (φ, θ, ψ) of the next objec to be packed.
Executes the packing action (updating variable with packed items) on the robot asynchronously in another thread.
Compute reward, backpropagates, and adjusts exploration probability for training iterations.
Performs experience replay .
Saves model snapshots and logs information for analysis.
The main testing loop iteratively performs the following steps:
For train_episode in range(2000):
Initialize simulation
Load num_loaded_objects items
For i in range(num_loaded_objects)
If n_unpacked items == 0:
Compute the number of packed objects, stability, compactness and priamidality of the box
break
else:
Comupute heightmap of box
If no remaining space in the box:
Compute the number of packed objects, stability, compactness and priamidality of the box
break
else:
Order remaining objects accoding to BBox volume
Select the K objects with highest BBox volume
Compute Heightmaps of the K objects (6 views) and concatenate with Box Heightmap
Run a forward pass through the Manager network to get SCORES for the next object to be packed.
Select next object to be packed according to this scores
For different (r,p,y) obtain heigthmaps of the remaining objects to be packed and concatenate with Box Heightmap
Runs a forward pass through the worker network to get SCORES for pos (X,Y) and ori (φ, θ, ψ) of the next objec to be packed.
Executes the packing action (updating variable with packed items) on the robot asynchronously in another thread.