-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An instance with new type could be added to the KB but it should not #304
Comments
Hi Diego,
It apparently does, based on your examples. To the question of "should it accept instances of non-existing type" I would say it shouldn't, and this is a bug.
I would need to look into detail, but my guess here is that in RQT for instance it gets all the types, and then it gets the instances of each type. As it doesn't have the type robot, it can't find r.
If you call
That is the use-case I am not sure I can see. The planner will plan with the domain that the knowledge base receives, which doesn't have the robot type. When you add an instance of another type, it will then appear in the problem file generated by the problem generator, but not in the domain, which will likely result in the planner giving an error. I believe this is why there's no service to add types because we are not generating the domain file, so adding a type would create this inconsistency between the knowledge base and the domain it was instantiated from. Pinging @m312z as he'll probably can give more about the reasons for all this and correct me if I'm wrong. |
The current knowledge base expects the state to change, but the domain to remain static. In the implementation, the state is contained within a set of c++ data types and the domain is retrieved from VAL's data structures as required (see ptree.h). Gerard is correct that in many places the types are fetched, then each instance of those types. Also that an object of a non-existant type would crash the planners. In any case, if the domain is using types, then the new object's type would not match any of the parameter types for the operators, and so should be unusable. Modifying the domain would be a very useful feature. Then the domain and problem could be auto-generated together. |
Thanks both for yours quick answers! I would summarize them in two points:
Please, could you confirm my understanding? About my use case, I don't have any, I have arrived to this situation due to a wrong modification of my domain file :-). |
Hi Diego, |
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:
All the instances are dded to the Knowledge Base, also 'r' that was not defined in the domain file. I see the following trace:
Although 'r' is not see in RQT application for ROSPlan, I could retrieve the instance from the KB.
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:
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:
Thanks in advance.
The text was updated successfully, but these errors were encountered: