BehaviorTree / BehaviorTree.CPP

Behavior Trees Library in C++. Batteries included.
https://www.behaviortree.dev
MIT License
3.02k stars 661 forks source link

[Nav2 Integration] Some BT nodes with registration are not being properly found at run-time #390

Closed SteveMacenski closed 2 years ago

SteveMacenski commented 2 years ago

Hi,

We're having a really bizarre issue with BT.CPP that we could use some help with. We've added a few BT nodes recently and some are failing to be usable in behavior tree XML files.

The BT nodes are compiling but we're finding that the builder in the BT registration macro isn't being called in these unique situations. So even though the BT node exists, they're not being registered as plugins to be able to be run-time loadable. This is affecting a number of recently added BT nodes to Nav2, with one example below. At run-time, the BT creation call hangs indefinitely without returning any warning or throwing any error, which is strange as well.

Do you have any idea why this is happening or what's gone wrong? I've looked over these files many times and compared them to other BT nodes we have in Nav2 using the same base classes that are working perfectly fine. We've tried removing caches and similar techniques in case its a bad compiler state, but it happens to these particular nodes, every time.

One example:

Another example is the BackUpCancel node, so you have 2 examples using completely different base libraries.

CC @jwallace42 @padhupradheep both of which have BT nodes that are in this limbo. More discussion https://github.com/ros-planning/navigation2/pull/2934

SteveMacenski commented 2 years ago

After more investigation, its not just happening in our unit tests either, it happens in CI testing of the main BT navigator server which works for users in production https://github.com/ros-planning/navigation2/pull/2962#issuecomment-1139798508. Something seems off with BT.CPP potentially (or our use of it?)

They are being registered from a comment in the ticket https://github.com/ros-planning/navigation2/pull/2934 - it works out side of CI use-cases it seems

SteveMacenski commented 2 years ago

Nevermind, pretty sure I just found it and its 100% on us. Sorry for the noise.