Skip to content
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

Declared type [int] != current type [void] exception #433

Closed
eschembor-irobot opened this issue Sep 23, 2022 · 2 comments
Closed

Declared type [int] != current type [void] exception #433

eschembor-irobot opened this issue Sep 23, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@eschembor-irobot
Copy link

The full exception that is thrown is

Blackboard::set() failed: once declared, the type of a port shall not change. Declared type [int] != current type [void]

Here is an example tree that reproduces this issue:

<BehaviorTree ID="Subtree1">
    <Decorator ID="Repeat" num_cycles="{port_to_use}">
        <Action ID="AlwaysSuccess"/>
    </Decorator>
</BehaviorTree>

<BehaviorTree ID="Subtree2">
    <Action ID="SetBlackboard" output_key="test_port" value="{port_to_read}"/>
</BehaviorTree>

<BehaviorTree ID="TestTree">
    <Control ID="Sequence">
        <Action ID="SetBlackboard" output_key="test_port" value="1"/>
        <SubTree ID="Subtree1" port_to_use="test_port"/>
        <SubTree ID="Subtree2" port_to_read="test_port"/>
    </Control ID="Sequence">
</BehaviorTree>

I think what is happening is that "Subtree1" is first reading from test_port as an int, whereas "Subtree2" is then reading from test_port as a void-typed port. Switching the order so that "Subtree2" is invoked before "Subtree1" does not reproduce the exception.

Should this really throw an exception? Should we not throw this exception if the port isn't changing to a void type?

@facontidavide facontidavide self-assigned this Sep 23, 2022
@facontidavide facontidavide added the bug Something isn't working label Sep 23, 2022
@facontidavide
Copy link
Collaborator

I was specifically working on this issue today (in the V4 branch).
Once it is fixed, I will backport those changes

facontidavide added a commit that referenced this issue Sep 23, 2022
@facontidavide
Copy link
Collaborator

Fixed :)
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants