-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Hi,
I've been using the library and I have a doubt about the way RosTopicPubNode is implemented. On subscribers, services and actions the base class use a registry to avoid duplication of instances (similar to a classical singleton pattern although not the same) but this doesn't happen with publishers. I understand that a ROS 2 publisher is more lightweight so duplication doesn't seem an issue but I have a complex tree where it slows down a lot the performance. So as an example if we have a tree like this:
<BehaviorTree ID="MySubtree">
<Sequence>
<MyPublisher />
</Sequence>
</BehaviorTree>
And then I include the subtree in 5 different places it will create 5 instances. But if these places are also subtrees that are reused the growth is quite exponential.
Although it may seem a design issue on my trees, I think the whole purpose of Behavior Trees is that you can compose behavior and reuse components so I'm trying to understand if could be worth to implement the publisher class in a similar way than the subscriber or I'm missing something in my logic reasoning.
Thanks!