KCL-Planning / ROSPlan

The ROSPlan framework provides a generic method for task planning in a ROS system.
http://kcl-planning.github.io/ROSPlan
BSD 2-Clause "Simplified" License
356 stars 158 forks source link

PDDL questions #188

Closed keerthanamanivannan closed 5 years ago

keerthanamanivannan commented 5 years ago

@oscar-lima @m312z

Background:

So, most of the things on the internet about PDDL are just basic examples and I have a specific thing which I want to accomplish and I need some help with that.

I have a really basic domain file and a problem file which spits out a single action when given into ROSPlan framework. I get this

rostopic echo /rosplan_plan_dispatcher/action_dispatch
action_id: 0
name: "stow"
parameters: 
  - 
    key: "move_group"
    value: "arms"
duration: 5.0
dispatch_time: 0.0
---

when I listen to the action dispatch topic.

I am giving this output into FlexBE so I created a rosplan_interface_flexbe package much like the rosplan_interface_movebase but gutted out to conform to FlexBE message type.

Now. I need to get one more key called skip_check to be set to True for any action that ROSPlan is going to spit out. How would I add this parameter (?) to all the actions in the PDDL file?

Thanks in advance for your time! Any links on more detailed PDDL examples would be really helpful too. Thank you!

Domain File

(:requirements :typing :durative-actions)

(:types
    arm)

(:predicates
    (stowed ?move_group - arm)
    (unstowed ?move_group - arm)

)
; transformation action
(:durative-action stow
   :parameters (?move_group - arm
   :duration (= ?duration 5)
   :condition (at start (unstowed ?move_group))
   :effect (and (at end (stowed ?move_group))
                (at start (not (unstowed ?move_group))))
)

; transformation action
(:durative-action unstow
  :parameters (?move_group - arm
  :duration (= ?duration 5)
  :condition (at start (stowed ?move_group))
  :effect (and (at end (unstowed ?move_group))
               (at start (not (stowed ?move_group))))
)
)

Problem File

(:domain deep-dive)
(:objects
    arms - arm
)
(:init

    (unstowed arms)

)
(:goal (and
    (stowed arms)
))
)
keerthanamanivannan commented 5 years ago

uh, so I just saw this issue #166. Um. So I cannot add the skip_check as a constant then?

m312z commented 5 years ago

Hello,

Does the key have to be a part of the PDDL, or can it be added to the interface?

To add the parameter to the PDDL:

First, you are right. PDDL constants are not implemented yet, but it is on our immediate to-do list.

One solution would be to add the parameter as a type instead, by extending the domain to include: (:types skip_check) And the problem file: (:objects true - skip_check) And finally include skip_check as a parameter of stow and unstow. The only possible value this parameter can take is "true".

One issue with this is that it is possible that your interface might reject an action for which skip_check is not set to "true", as no other option exists. In other words, I'm not sure how to define some actions to be valid for dispatch, but not possible for the planner to select (constants would not help with this).

keerthanamanivannan commented 5 years ago

I see. Yeah. This helps a lot, @m312z. I realized that we need to send this skip_check to always be set to True as a part of the stow/unstow action. Which then makes sense for me to add it into the interface. I tried the whole adding it to the PDDL file approach you mentioned, but rosplan_knowledge_base node dies when I do that.

But you've helped me fix this problem. Thank you for your time Mike, I really appreciate it.

keerthanamanivannan commented 5 years ago

Closing this issue.