ROSPlan icon indicating copy to clipboard operation
ROSPlan copied to clipboard

Same goal could be stored in KB multiple times

Open dgerod opened this issue 5 years ago • 1 comments

It is possible to a set same goal in the KB in some situation, but it should not be as they should be unique.

In this case it works well:

object-at o=item_0 p=b1
object-at o=item_0 p=b1

The second goal is not stored in the KB. However, in case of:

object-at p=b1 o=item_0
object-at o=item_0 p=b1

Two goals are stored, the information stored in the KB is:

[knowledge_type: 1
initial_time: 
  secs: 0
  nsecs:         0
is_negative: False
instance_type: ''
instance_name: ''
attribute_name: "object-at"
values: 
  - 
    key: "p"
    value: "b1"
  - 
    key: "o"
    value: "item_0"
function_value: 0.0
optimization: ''
expr: 
  tokens: []
ineq: 
  comparison_type: 0
  LHS: 
    tokens: []
  RHS: 
    tokens: []
  grounded: False]
[knowledge_type: 1
initial_time: 
  secs: 0
  nsecs:         0
is_negative: False
instance_type: ''
instance_name: ''
attribute_name: "object-at"
values: 
  - 
    key: "o"
    value: "item_0"
  - 
    key: "p"
    value: "b1"
function_value: 0.0
optimization: ''
expr: 
  tokens: []
ineq: 
  comparison_type: 0
  LHS: 
    tokens: []
  RHS: 
    tokens: []
  grounded: False]

The number of repeated goals depends on the number of "values" of a knowledge item, in this example it is two.

This issue is related to #253 because it is not considering that the "values" of an knowledge item could be stored in a different order. But, here the fix should be done before storing the data in KB while in the other the fix should be done when data is retrieved from KB.

Although I have not checked predicates and others, I think that this situation happens to all them.

dgerod avatar Jul 17 '20 09:07 dgerod

In the knowledge comparitor I think we must have been lazy and assumed the ROS messages use the PDDL parameter order. We should check this.

Michael

m312z avatar Apr 01 '21 08:04 m312z