ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
It is bad, because the publisher/subscribers will need some time to "find" there connection. If you create new ones all the time, and immediately publish, you'll probably get zero messages through.
If that is you only insertion point, you could create them static or call some init() function once, that sets up the publishers.
On a side note: you might want to set that up as Nodelets as it seems to be that you'll be passing a lot of stuff around.