Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is not a direct answer to your question. But a simpler (yet more naive) way to do what you want. Instead of using boost:share_ptr, I usually globally declare a pointer of type tf::TransformBroadcaster first. Next, In the main function, I use new to create the object after ros::init.

//Global Variable(s)
tf::TransformBroadcaster *tb;
// Rest of the code
int main(int argc, char **argv) {
    // After ros::init
    tb = new tf::TransformBroadcaster();