0
votes

I am new to PDDL and AI planning area. I am actually creating a plan for a humanoid interacting with a human in a scenario. The scenario is as follows

  1. Human enters the room (where robot and some objects are present in the room)
  2. Robot detects human
  3. Greets human after detecting
  4. Then human asks for a cup
  5. Robot assumes that human wants to drink coffee and responds to human on what time human took medication (there should be a gap of 1 hour for medication and coffee)
  6. Human responds with the time
  7. If the time matches to 1 hour gap, Robot responds that it will find cup
  8. Robot detects the cup on the table
  9. Robot responds to human that cup is on the table
  10. Human picks the cup
  11. Robot greets the human after detecting that the human is holding the cup

My PDDL domain file logic is as follows:

(define (domain sp)
 (:requirements :typing :strips :adl)


 (:types    location agent item - object 
            robot human speak - agent 
            room - location
            fruit cup table - item
            clear polite listenatt - speak)

(:predicates    
        (at ?o - object ?l - location)
        (detected_human ?p - human  ?l - room)
        (greeted ?r - robot ?p - human)
        (detected_cup ?c - cup  ?l - room)
        (holded ?c - cup ?p - human)
        (medichecked ?r - robot ?p - human)
        (human_asked ?p - human)
        (robot_responded ?r - robot ?cl - clear ?pl - polite)
)


    (:action detect_human
        :parameters (?p - human ?r - robot ?l - location)
        :precondition (at ?r ?l)
        :effect (detected_human ?p ?l)
    )

    (:action detect_cup
        :parameters (?p - human ?c - cup ?r - robot ?l - location )
        :precondition (and (detected_human ?p ?l) 
                           (human_asked ?p) 
                           (medichecked ?r ?p) 
                           )
        :effect (detected_cup ?c ?l) 
    )

    (:action greet
        :parameters (?r - robot ?p - human ?l - location ?pl - polite ?cl - clear)
        :precondition (and (at ?r ?l) (detected_human ?p ?l)) 
        :effect (and (greeted ?r ?p) (robot_responded ?r ?cl ?pl))
    )

    (:action hold
        :parameters (?c - cup ?p - human ?l - location ?r - robot ?cl - clear ?pl - polite)
        :precondition (and (detected_human ?p ?l) 
                           (detected_cup ?c ?l) 
                           (robot_responded ?r ?cl ?pl) 
                           (medichecked ?r ?p) 

                           ) 
        :effect (holded ?c ?p)
    )    
    
    (:action check_medi
        :parameters (?p - human ?l - location ?r - robot)
        :precondition (human_asked ?p) 
        :effect (medichecked ?r ?p)
    )  
    
    (:action human_ask
        :parameters (?p - human ?l - location ?r - robot)
        :precondition (and (detected_human ?p ?l) (greeted ?r ?p))
        :effect (human_asked ?p)
    )  
    
    (:action robot_respond
        :parameters (?p - human ?l - location ?r - robot ?cl - clear ?pl - polite ?c -cup)
        :precondition (and (at ?r ?l) (detected_human ?p ?l)) 
        :effect (and (when (human_asked ?p) (robot_responded ?r ?cl ?pl))
                     (when (detected_cup ?c ?l) (robot_responded ?r ?cl ?pl)))
    )  
)

My PDDL problem file is as follows:

(define (problem test12)
(:domain sp)

(:objects person0 - Human 
          pepper0 - Robot 
          apple - Fruit
          cup0 - Cup
          table0 - Table
          room0 - Room
          clear0 - Clear
          polite0 - Polite)

(:init
(at pepper0 room0)


)
(:goal (holded cup0 person0)
)

currently it generates the following plan:


plan-found
(detect_human person0 pepper0 room0)
(greet pepper0 person0 room0 polite0 clear0)
(human_ask person0 room0 pepper0)
(check_medi person0 room0 pepper0)
(detect_cup person0 cup0 pepper0 room0)
(hold cup0 person0 room0 pepper0 clear0 polite0)

I wanted the expected plan to be something like this:


plan-found
(detect_human person0 pepper0 room0)
(greet pepper0 person0 room0 polite0 clear0)
(human_ask person0 room0 pepper0)
(robot_respond person0 polite0 clear0 room0)
(check_medi person0 room0 pepper0)
(robot_respond person0 polite0 clear0 room0)
(detect_cup person0 cup0 pepper0 room0)
(robot_respond person0 polite0 clear0 room0)
(hold cup0 person0 room0 pepper0 clear0 polite0)

I am not sure why the robot_respond action is never coming in the plan even though it is given in the effects and preconditions.

I appreciate if any direction on this problem. Its been more than a week I am struggling to get the logic correct.

1
I am not quite sure how exactly you want to model your problem. Anyway, my understanding is that the robot should respond after certain actions and the person should wait for the response? You can achieve this with the robot_responded ... variable by adding robot_responded ... to the precondition of the human actions and adding (not (robot_responded ... )) as an effect. You probably also need to add (not (greeded ...) to the precondition of action greet.David Speck
@David Speck, Your understanding of my problem is accurate. I have modified based on your comments and it works exactly how I wanted it to be. The reason I am developing the way it is because it (the robot) has to follow certain social practice norms like speaking politely with humans, having gestures while speaking and listening, etc. That will be closely matching to human-to-human interaction.mkpisk

1 Answers

0
votes

It’s indispensable for the action ‘robot-response’? I mean it looks like you didn’t set any effects in action ‘robot-response’ as a condition for others or possibly the same predicate ‘(robot-responsed)’ can be satisfied in action ‘greet’?