Reputation: 152
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
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.
Upvotes: 0
Views: 102
Reputation: 1
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’?
Upvotes: 0