Docsity

Planning - Embedded Intelligent Robotics - Lecture Slides, Slides of Robotics

Partial preview of the text

Download Planning - Embedded Intelligent Robotics - Lecture Slides and more Slides Robotics in PDF only on Docsity!

1

Planning

2

Planning problem

  • Find a sequence of actions that achieves a given goal when executed from a given initial world state. That is, given - a set of operator descriptions (defining the possible primitive actions by the agent), - an initial state description, and - a goal state description or predicate, compute a plan, which is - a sequence of operator instances, such that executing them in the initial state will change the world to a state satisfying the goal-state description.
  • Goals are usually specified as a conjunction of goals to be achieved

4

Typical assumptions

  • Atomic time: Each action is indivisible
  • No concurrent actions are allowed (though actions do not need to be ordered with respect to each other in the plan)
  • Deterministic actions: The result of actions are completely determined—there is no uncertainty in their effects
  • Agent is the sole cause of change in the world
  • Agent is omniscient: Has complete knowledge of the state of the world
  • Closed World Assumption: everything known to be true in the world is included in the state description. Anything not listed is false.

5

Major approaches

  • GPS / STRIPS
  • Situation calculus
  • Partial order planning
  • Hierarchical decomposition (HTN planning)
  • Planning with constraints (SATplan, Graphplan)
  • Reactive planning

7

Situation calculus planning

  • Initial state : a logical sentence about (situation) S (^0) At(Home, S 0 ) ^ ~Have(Milk, S 0 ) ^ ~ Have(Bananas, S 0 ) ^ ~Have(Drill, S 0 )
  • Goal state : (∃s) At(Home,s) ^ Have(Milk,s) ^ Have(Bananas,s) ^ Have(Drill,s)
  • Operators are descriptions of actions: ∀(a,s) Have(Milk,Result(a,s)) <=> ((a=Buy(Milk) ^ At(Grocery,s)) ∨ (Have(Milk, s) ^ a~=Drop(Milk)))
  • Result(a,s) names the situation resulting from executing action a in situation s.
  • Action sequences are also useful: Result'(l,s) is the result of executing the list of actions (l) starting in s: (∀s) Result'([],s) = s (∀a,p,s) Result'([a|p]s) = Result'(p,Result(a,s))

8

Situation calculus planning II

  • A solution is thus a plan that when applied to the initial state yields a situation satisfying the goal query: At(Home,Result'(p,S 0 )) ^ Have(Milk,Result'(p,S 0 )) ^ Have(Bananas,Result'(p,S 0 )) ^ Have(Drill,Result'(p,S 0 ))
  • Thus we would expect a plan (i.e., variable assignment through unification) such as: p = [Go(Grocery), Buy(Milk), Buy(Bananas), Go(HardwareStore), Buy(Drill), Go(Home)]

10

Basic representations for planning

  • Classic approach first used in the STRIPS planner circa 1970
  • States represented as a conjunction of ground literals
    • at(Home) ^ ~have(Milk) ^ ~have(bananas) ...
  • Goals are conjunctions of literals, but may have variables which are assumed to be existentially quantified - at(?x) ^ have(Milk) ^ have(bananas) ...
  • Do not need to fully specify state
    • Non-specified either don’t-care or assumed false
    • Represent many cases in small storage
    • Often only represent changes in state rather than entire situation
  • Unlike theorem prover, not seeking whether the goal is true, but is there a sequence of actions to attain it

11

Operator/action representation

  • Operators contain three components:
    • Action description
    • Precondition - conjunction of positive literals
    • Effect - conjunction of positive or negative literals which describe how situation changes when operator is applied
  • Example: Op[Action: Go(there), Precond: At(here) ^ Path(here,there), Effect: At(there) ^ ~At(here)]
  • All variables are universally quantified
  • Situation variables are implicit
    • preconditions must be true in the state immediately before operator is applied; effects are true immediately after

Go(there)

At(here) ,Path(here,there)

At(there) , ~At(here)

13

Blocks world operators

  • Here are the classic basic operations for the blocks world:
    • stack(X,Y): put block X on block Y
    • unstack(X,Y): remove block X from block Y
    • pickup(X): pickup block X
    • putdown(X): put block X on the table
  • Each will be represented by
    • a list of preconditions
    • a list of new facts to be added (add-effects)
    • a list of facts to be removed (delete-effects)
    • optionally, a set of (simple) variable constraints
  • For example: preconditions(stack(X,Y), [holding(X),clear(Y)]) deletes(stack(X,Y), [holding(X),clear(Y)]). adds(stack(X,Y), [handempty,on(X,Y),clear(X)]) constraints(stack(X,Y), [X==Y,Y==table,X==table])

14

Blocks world operators II

operator(stack(X,Y), Precond [holding(X),clear(Y)], Add [handempty,on(X,Y),clear(X)], Delete [holding(X),clear(Y)], Constr [X==Y,Y==table,X==table]).

operator(pickup(X), [ontable(X), clear(X), handempty], [holding(X)], [ontable(X),clear(X),handempty], [X==table]).

operator(unstack(X,Y), [on(X,Y), clear(X), handempty], [holding(X),clear(Y)], [handempty,clear(X),on(X,Y)], [X==Y,Y==table,X==table]).

operator(putdown(X), [holding(X)], [ontable(X),handempty,clear(X)], [holding(X)], [X==table]).

16

Typical BW planning problem

Initial state: clear(a) clear(b) clear(c) ontable(a) ontable(b) ontable(c) handempty

Goal: on(b,c) on(a,b) ontable(c)

A C B

A

B

C

A plan: pickup(b) stack(b,c) pickup(a) stack(a,b)

17

Another BW planning problem

Initial state: clear(a) clear(b) clear(c) ontable(a) ontable(b) ontable(c) handempty

Goal: on(a,b) on(b,c) ontable(c)

A C B

A

B

C

A plan: pickup(a) stack(a,b) unstack(a,b) putdown(a) pickup(b) stack(b,c) pickup(a) stack(a,b)

19

Sussman Anomaly

A B

C

Initial state

Goal state

Achieve on(a,b) via stack(a,b) with preconds: [holding(a),clear(b)] |Achieve holding(a) via pickup(a) with preconds: [ontable(a),clear(a),handempty]||Achieve clear(a) via unstack(_1584,a) with preconds: [on(_1584,a),clear(_1584),handempty] ||Applying unstack(c,a)||Achieve handempty via putdown(_2691) with preconds: [holding(_2691)] ||Applying putdown(c)|Applying pickup(a) Applying stack(a,b) Achieve on(b,c) via stack(b,c) with preconds: [holding(b),clear(c)]|Achieve holding(b) via pickup(b) with preconds: [ontable(b),clear(b),handempty] ||Achieve clear(b) via unstack(_5625,b) with preconds:[on(_5625,b),clear(_5625),handempty] ||Applying unstack(a,b) ||Achieve handempty via putdown(_6648) with preconds: [holding(_6648)]||Applying putdown(a) |Applying pickup(b)Applying stack(b,c) Achieve on(a,b) via stack(a,b) with preconds: [holding(a),clear(b)] |Achieve holding(a) via pickup(a) with preconds: [ontable(a),clear(a),handempty]|Applying pickup(a) Applying stack(a,b)

From [clear(b),clear(c),ontable(a),ontable(b),on (c,a),handempty] To [on(a,b),on(b,c),ontable(c)] Do: unstack(c,a) putdown(c) pickup(a) stack(a,b) unstack(a,b) putdown(a) pickup(b) stack(b,c) pickup(a) stack(a,b)

A

B

C

20

State-space planning

  • We initially have a space of situations (where you are, what you have, etc.)
  • The plan is a solution found by “searching” through the situations to get to the goal
  • A progression planner searches forward from initial state to goal state
  • A regression planner searches backward from the goal
    • This works if operators have enough information to go both ways
    • Ideally this leads to reduced branching –you are only considering things that are relevant to the goal