ROSPlan icon indicating copy to clipboard operation
ROSPlan copied to clipboard

Using subtypes for domain predicates produces issues for sensing interface

Open mdmdmd987 opened this issue 4 years ago • 1 comments

Hi everyone,

I am currently trying to make use of the sensing interface in one of my projects. The problem is that I defined predicates which should work with several types and therefore defined them as sub-types as demonstrated in the following example:

(:types a b - a c - a)
(:predicates (pred1 ?x - a))

(:objects b1 - b c1 - c)

As described in Tutorial 11, I want to define my own "def pred1(msg, params)” function, which requires the usage of ‘*’ wildcards. However because I use the super-type in the predicates definition, params returns an empty list. I guess the problem is that the GetInstanceService is used to get hold of the instances (l. 154 in the ROSPlan/rosplan_sensing_interface/scripts/sensing_interface.py), which does not loop through sub-types.

Is this something you would like to include into ROSPlan?

Thank you and best regards, Maxi

mdmdmd987 avatar Jun 23 '20 09:06 mdmdmd987

The issue is in the knowledge base. Types/supertypes are stored correctly, but at this line (of get instances) only the objects of the specific sub/super-type are returned. https://github.com/KCL-Planning/ROSPlan/blob/3bb7563bf3bef5e37eaf8532a9a64d043e1ee67b/rosplan_knowledge_base/src/KnowledgeBase.cpp#L503

m312z avatar Apr 01 '21 09:04 m312z