Skip to content

An instance with new type could be added to the KB but it should not #304

@dgerod

Description

@dgerod

While working with KB, I have a conceptual doubt.

There is domain file that defines 'place', 'bin' and other types but not 'robot', and this file is loaded by the Knowledge Base when it is started. Now I add the following instances:

  • 'home' of type 'place'
  • 'bin_2' of type 'bin''
  • 'bin_3' of type 'bin''
  • 'r' of type 'robot'.

All the instances are dded to the Knowledge Base, also 'r' that was not defined in the domain file. I see the following trace:

Node: /rosplan_knowledge_base
Time: 10:43:13.422947385 (2021-08-24)
Severity: Info
Published Topics: /rosout, /rosplan_knowledge_base/status/update

KCL: (/rosplan_knowledge_base) Adding instance (robot, r)
 
Location:
/home/ubuntu/ros_ws/src/rosplan/rosplan_knowledge_base/src/KnowledgeBase.cpp:KnowledgeBase::addKnowledge:383 

Although 'r' is not see in RQT application for ROSPlan, I could retrieve the instance from the KB.

image

I have a code in which I retrieve all the instances of the KB including their types, see here. When I execute it, all instance are retrieved with the type except 'r' that is returned without type. To retrieve the type of an instance I am using "get domain types" service of the Knowledge Base, which calls the following code:

bool 
PDDLKnowledgeBase::getTypes(
   rosplan_knowledge_msgs::GetDomainTypeService::Request  &req,
   rosplan_knowledge_msgs::GetDomainTypeService::Response &res) 
{
...
}

At this moment I am a bit confused, for me it is not clear what is the expectation of this situation. And I think the behavior is not coherent. So, I have several questions:

  • Does KB accept instances of non existing type in its domain?
  • Why these instances are managed different that the ones which type is defined in the domain? They are not shown in the same place and the type is not stored in the domain information with others.
  • In case that current behavior is correct, how should I get the types of all instances without considering if they are part of the domain or not?
  • How a new type of an instance could be added without modifying the domain file?
    Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions