You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an incorrect behavior in version 5.0.0 that makes python components publish their predicates periodically, even though they don't change the value.
The text was updated successfully, but these errors were encountered:
Additionally, there is another detail that might cause confusion: the Predicate class in both cpp and py initializes the previous_value attribute to the opposite value of the initial value of the predicate. It was the intention that the first time around in the step function, the query() call would return a value and the initial value would be published as a predicate. However, we missed the fact that if one does
p = Predicate(lambda: False)
p.set_predicate(lambda: True)
value = p.query() # --> this will be none instead of true!
i.e. change the predicate value before the step (or anyone else, but it will be the step function) queries the predicate value for the first time, it will return None because internally in fact the predicate value hasn't changed. This can indeed happen in test scenarios where we spin manually or in the execute behavior of components. Two potential fixes:
Fix it in the component interface and publish the predicate directly on ComponentInterface::add_predicate to make sure it's queried immediately. This is a simple non breaking change
Fix it in the Predicate class to have an uninitialized previous_value on construction. This is cleaner but technically a breaking change.
There is an incorrect behavior in version 5.0.0 that makes python components publish their predicates periodically, even though they don't change the value.
The text was updated successfully, but these errors were encountered: