How to define a tranform listener
I am using this code in order to relate the point cloud with the pose information.
Also, the code found here looks like below:
laser_geometry::LaserProjection projector_;
tf::TransformListener listener_;
void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_in)
{
sensor_msgs::PointCloud cloud;
projector_.transformLaserScanToPointCloud("base_link",*scan_in,cloud,listener_);
// Do something with cloud.
}
How should I define the "listener_" variable in order to use it?