Skip to content

Precondition Decorator documentation is unclear #1177

Description

@mdtoom

Describe the bug
When I read the documentation of the Precondition decorator here, it appears to me that the condition is evaluated every time the node is ticked and then if true goes to the child node and if false returns the else.

But the actual behavior is that it is only evaluated at the beginning and then the child node is executed without rechecking the condition.

Do I understand the documentation incorrectly?
And if not, maybe the documentations should be updated and what is the correct way to obtain this behavior?

Currently we are using:

<ReactiveSequence>
    <Precondition if="battery_ok" else="FAILURE">
        <AlwaysSuccess/>
    </Precondition>
    <Sequence>
            ....
     </Sequence>
</ReactiveSequence>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions