ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Hi Martin,

boost::shared_ptr<tf::TransformListener> tf_ptr;

...

int main(int argc, const char* argv []) {

  ros::init(argc, argv, "my_node");
  tf_ptr.reset(new tf::TransformListener);

  ... do more stuff here. Use tf_ptr as a regular pointer for the most part ...

  return 0;
}

The comments in this thread also explain the same answer.