Written by @christos_chrysikos
I would like to ask you about the best practice to input information from the ROS domain to the BT domain.
I am currently working with ROS1 noetic, and these are the two approaches I am thinking:
- Use the “main.cpp”, where I am initializing ros and registering the BT, to subscribe to all the required topics and use the subscriber callbacks to transfer the information in the blackboard. Then each BT node uses blackboard for checking conditions, halting processes, etc.
- Each BT node that requires data from the ROS domain subscribes itself to the specfic topic/topics and doesn’t involve the blackboard at all. Then use the blackboard only for sharing non ROS related information between the BT nodes.
From my understanding, the second approach is the one used in Navigation2 with BT.CPP, and I think this is a more cleaner and modular solution.
I would like to hear the opinions of the whole community, and of course if there are available code examples in ROS1 would be more than welcome.