tranformation using static publisher and listener
Hi,
If I have two frames I want to do transformation.. in my code i have the following:
void laserCallback (const sensor_msgs::LaserScan::ConstPtr& scan_in)
{
double t1 = ros::Time::now().toSec() ;
//std::cout<<"LASER" << scan_in->header.frame_id << std::endl ;
if(!listener_.waitForTransform(scan_in->header.frame_id,
"/uav/baselink_ENU",
scan_in->header.stamp + ros::Duration().fromSec(scan_in->ranges.size()*scan_in->time_increment),
ros::Duration(1.0)))
{
std::cout << "RETURN" << std::endl ;
return;
}
sensor_msgs::PointCloud msg;
// Which one of the follwoing should I use ?
//projector_.projectLaser(*scan_in, msg);
//projector_.transformLaserScanToPointCloud("/uav/baselink_ENU",*scan_in, msg,listener_);
}
Is this part needed if I have a static transformation :
if(!listener_.waitForTransform(scan_in->header.frame_id,
"/uav/baselink_ENU",
scan_in->header.stamp + ros::Duration().fromSec(scan_in->ranges.size()*scan_in->time_increment),
ros::Duration(1.0)))
{
std::cout << "RETURN" << std::endl ;
return;
}
I mean is it enough to have a static tf publisher and the following line ?
projector_.transformLaserScanToPointCloud("/uav/baselink_ENU",*scan_in, msg,listener_);