Figure 1: Automatic Planner System.
is capable of generating robot programs to assembly.
It was developed a system, which is shown in Figure
1 for this purpose, which is divided in the next sub-
systems: High-level-language Planner, Generic-level-
language Parser and Wrapper-generic-level-language.
This system produces a robot program written in
generic commands to do the assembly task.
3.1 High-level Planner
It was developed a language to describe the assembly
domain, in order to work with the Graphplan planner.
The language consists of propositions (to describe the
initial state) and operators (which are actions).
The planning process is defined as a tuple < P, A,
S
o
, G >, where P is a set of propositions in a language
Σ, A is a set of actions, S
o
⊂ P is the initial state, and
G ⊂ P is the goal state.
For example, an action A, meaning to pick and
place an object should be written as: (PickAndPlace
robot container1 fastener1), where container1 is the
picking location and fastener1 is the placing posi-
tion.
An example of the language to describe the ini-
tial state, S
o
, is (have container1 tube1), which rep-
resents that the container1 has the tube1.
Following the same reasoning, it is possible to
describe an assembly goal G, as (assemblyCorner90
tube1 tube2) which represent a Corner joint with an
angle of 90
◦
using the tubes: tube1 and tube2.
Let Σ =< Pn, L,C > be a first-order language
composed of a set of predicate names Pn =
{pn
1
, pn
2
, pn
3
, ..., pn
w
}, a set of literal constants
L = {l
1
, l
2
, l
3
, ..., l
n
}, and a set of classes C =
{c
1
, c
2
, c
3
, ..., c
m
}. The function f
c
:
f
c
: L → C
associates each literal constant to a class (or object
type). Then the set of literals (or propositions) P =
{p
1
, p
2
, p
3
, ..., p
w
}, where p
i
= (pn
x
, l
i1
....l
im
) is a list
involving constants and a predicate name. Also
ˆ
P =
( ˆp
1
, ˆp
2
, ˆp
3
, ..., ˆp
q
) is defined as a set of propositions,
where ˆp
i
= (pn
y
, l
i1
....l
ik
) is a list involving constants
and a predicate name too. Then we define the function
f
p
by:
f
p
: P →
ˆ
P
∀p
i
= (pn
x
, l
i1
, ..., l
ik
), f
p
(p
i
) = ˆp
j
:
ˆp
j
= (pn
x
, f
c
(l
i1
)... f
c
(l
ik
)).
This function is overload as:
F
p
: {P} → {
ˆ
P} : ∀J ⊂ P, F
p
(J) = f
p
( j
i
), ∀ j
i
∈ J.
An example of a literal is (have container1 tube1) ,
where have is a predicate name while container1 and
tube1 are literal constants of the class container and
tube.
Given an action A = {Pre, Post} as a set of
two kind of propositions: preconditions and post-
conditions of the initial state, S
o
, where preconditions
are the requirements to be accomplished before ac-
tion, and the post-conditions are the description of the
state after action. The function F
A
is defined as:
F
A
: {P} → {
ˆ
P}
∀a = {Pre, Post}, F
A
(a) = {F
p
(Pre), F
p
(Post)}.
Using these definitions, the planning problem can
be written in the proposed language with the form
{F
p
(P), F
A
(A), F
p
, S
o
, F
p
(G)}. The high-level plan is
obtained by applying the actions A to the initial state
F
p
(S
o
) to reach the goal F
p
(G). This high-level-
language plan will be parsed to obtain the robot pro-
gram.
3.2 Generic-level Parser
The generated high-level plan explained in the previ-
ous section, is the input to generic-level Parser. The
purpose of this subsystem is to act as intermediary be-
tween the Planner subsystem and the Robot system.
In order to accomplish this purpose, it was decided
to parse each high-level operation to produce generic-
level commands for the pick-and-place robot. This
parsing consists in recognizing a string (high-level-
operation) by dividing it into a set of symbols (or to-
kens) and analyzing each one of them against the de-
veloped grammar in this work.
Algorithm 1: ParseGenerator(E).
Require: A set of expressions E.
Ensure: Change every expression from high to generic level.
1: for e ∈ E, x ∈ instances o f e do
2: parsing: e(x)
3: Add e(x) to the robot program
4: end for
5:Compile robot program
Algorithm 1 provides a way to parse a set of high-
level-language expressions to generic-level-language
expressions. Step one retrieves every high-level-
language expression. Next, step two parses every ex-
pression from high to generic level. Then, step three
adds every parsed expression to the robot program.
ICAART2013-InternationalConferenceonAgentsandArtificialIntelligence
548