Skip to content

Commit

Permalink
simple Problem file
Browse files Browse the repository at this point in the history
  • Loading branch information
rezan21 committed Jan 14, 2019
1 parent 327c55a commit b4a4ce6
Show file tree
Hide file tree
Showing 3 changed files with 225 additions and 1 deletion.
95 changes: 94 additions & 1 deletion launchFile.launch
Original file line number Diff line number Diff line change
@@ -1 +1,94 @@
<!-- launch file to be used by ROSplan and XAIP -->
<launch>

<arg name="domain" default="$(find explainable_planning)/common/supermarket-domain.pddl"/>

<!-- scene database (MongoDB) -->

<include file="$(find mongodb_store)/launch/mongodb_store.launch">
<arg name="db_path" value="$(find rosplan_knowledge_base)/common/mongoDB/"/>
</include>

<!-- knowledge base -->

<node name="rosplan_knowledge_base" pkg="rosplan_knowledge_base" type="knowledgeBase" respawn="false" output="screen">
<param name="domain_path" value="$(arg domain)"/>
<!-- change problem here -->
<param name="problem_path" value="$(find explainable_planning)/common/supermarket-problem.pddl"/>
<param name="database_path" value="$(find rosplan_knowledge_base)/common/mongoDB/"/>
<!-- conditional planning flags -->
<param name="use_unknowns" value="False"/>
</node>

<!-- problem generation -->

<node name="rosplan_problem_interface" pkg="rosplan_planning_system" type="problemInterface" respawn="false" output="screen">
<param name="domain_path" value="$(arg domain)"/>
<param name="problem_path" value="$(find rosplan_planning_system)/common/problem.pddl"/>
<param name="problem_topic" value="problem_instance"/>
<param name="knowledge_base" value="rosplan_knowledge_base"/>
</node>

<!-- planning system -->

<node name="rosplan_planner_interface" pkg="rosplan_planning_system" type="popf_planner_interface" respawn="false" output="screen">
<param name="knowledge_base" value="rosplan_knowledge_base"/>
<!-- general options -->
<param name="use_problem_topic" value="true"/>
<!-- ros topics -->
<param name="problem_topic" value="/rosplan_problem_interface/problem_instance"/>
<param name="planner_topic" value="planner_output"/>
<!-- directory for files -->
<param name="domain_path" value="$(arg domain)"/>
<param name="problem_path" value="$(find rosplan_planning_system)/common/problem.pddl"/>
<param name="data_path" value="$(find rosplan_planning_system)/common/"/>
<!-- to run the planner -->
<param name="planner_command" value="$(find rosplan_planning_system)/common/bin/popf DOMAIN PROBLEM"/>
</node>

<!-- plan parsing -->
<node name="rosplan_parsing_interface" pkg="rosplan_planning_system" type="pddl_simple_plan_parser" respawn="false" output="screen">
<param name="knowledge_base" value="rosplan_knowledge_base"/>
<param name="planner_topic" value="/rosplan_planner_interface/planner_output"/>
<param name="plan_topic" value="complete_plan"/>
</node>

<!-- plan explanation -->
<node name="rosplan_plan_explainer" pkg="explainable_planning" type="rpexplainer" respawn="false" output="screen">
<param name="plan_topic" value="/rosplan_parsing_interface/complete_plan"/>
<param name="action_dispatch_topic" value="action_dispatch"/>
<param name="action_feedback_topic" value="action_feedback"/>
</node>

<!-- sim actions -->
<!-- change actions here -->

<node name="rosplan_interface_pick" pkg="rosplan_planning_system" type="simulatedAction" respawn="false" output="screen">
<param name="knowledge_base" value="rosplan_knowledge_base"/>
<param name="pddl_action_name" value="pick"/>
<param name="action_duration" value="0.0"/>
<param name="action_probability" value="1.0"/>
<param name="action_dispatch_topic" value="/rosplan_plan_explainer/action_dispatch"/>
<param name="action_feedback_topic" value="/rosplan_plan_explainer/action_feedback"/>
</node>

<node name="rosplan_interface_drop" pkg="rosplan_planning_system" type="simulatedAction" respawn="false" output="screen">
<param name="knowledge_base" value="rosplan_knowledge_base"/>
<param name="pddl_action_name" value="drop"/>
<param name="action_duration" value="0.0"/>
<param name="action_probability" value="1.0"/>
<param name="action_dispatch_topic" value="/rosplan_plan_explainer/action_dispatch"/>
<param name="action_feedback_topic" value="/rosplan_plan_explainer/action_feedback"/>
</node>

<node name="rosplan_interface_move" pkg="rosplan_planning_system" type="simulatedAction" respawn="false" output="screen">
<param name="knowledge_base" value="rosplan_knowledge_base"/>
<param name="pddl_action_name" value="move"/>
<param name="action_duration" value="0.0"/>
<param name="action_probability" value="1.0"/>
<param name="action_dispatch_topic" value="/rosplan_plan_explainer/action_dispatch"/>
<param name="action_feedback_topic" value="/rosplan_plan_explainer/action_feedback"/>
</node>



</launch>
68 changes: 68 additions & 0 deletions supermarket-domain.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
(define (domain simple-supermarket)
(:requirements :strips :typing :numeric-fluents :durative-actions :conditional-effects)
(:types
location agent item- object

)
(:predicates
(at ?o - object ?l - location)
(notat ?a - agent ?l - location)
(agentfree ?a - agent)
(agentnotfree ?a - agent)
(agentfull ?a - agent)
(agentnotfull ?a -agent)
(on ?i - item ?a - agent)
(noton ?i - item ?a - agent)


)

(:functions
(capacity ?a - agent)
(itemsholding ?a agent)

)

(:durative-action pick
:parameters (?i - item ?a - agent ?l - location)
:duration (= ?duration 5)
:condition(
and(over all(at ?a ?l)) (at start(at ?i ?l))
)
:effect(and (at start(not (at ?i ?l))) (at end(on ?i ?a)))
)

(:durative-action drop
:parameters (?i - item ?a - agent ?l - location)
:duration (= ?duration 5)
:condition(
and(over all(at ?a ?l)) (at start(on ?i ?a))
)
:effect(and (at start(not (on ?i ?a))) (at end(at ?i ?l)))
)

(:durative-action move
:parameters (?a - agent ?from - location ?to - location)
:duration(= ?duration 10)
:condition(at start(at ?a ?from))
:effect(and(at start(not(at ?a ?from)) )(at end(at ?a ?to)) )

)

















)
63 changes: 63 additions & 0 deletions supermarket-problem.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
(define (domain simple-supermarket)
(:requirements :strips :typing :numeric-fluents :durative-actions :conditional-effects)
(:types
location agent item - object

)
(:predicates
(at ?o - object ?l - location)
;(notat ?a - agent ?l - location)
;(agentfree ?a - agent)
;(agentnotfree ?a - agent)
;(agentfull ?a - agent)
;(agentnotfull ?a -agent)
(on ?i - item ?a - agent)
;(noton ?i - item ?a - agent)
(haspath ?from - location ?to - location)


)


(:durative-action pick
:parameters (?i - item ?a - agent ?l - location)
:duration (= ?duration 5)
:condition(
and(over all(at ?a ?l)) (at start(at ?i ?l))
)
:effect(and (at start(not (at ?i ?l))) (at end(on ?i ?a)))
)

(:durative-action drop
:parameters (?i - item ?a - agent ?l - location)
:duration (= ?duration 5)
:condition(and(over all(at ?a ?l)) (at start(on ?i ?a))
)
:effect(and (at start(not (on ?i ?a))) (at end(at ?i ?l)))
)

(:durative-action move
:parameters (?a - agent ?from - location ?to - location)
:duration(= ?duration 10)
:condition(and (at start(at ?a ?from))(over all(haspath ?from ?to)))
:effect(and(at start(not(at ?a ?from)) )(at end(at ?a ?to)) )

)

















)

0 comments on commit b4a4ce6

Please sign in to comment.