hdl_localization 报错point cloud cannot be transformed into target frame!!
pcl_ros 不支持tf2,hdl_localization_nodelet.cpp中修改成tf:
//1.
//HdlLocalizationNodelet() : tf_buffer(), tf_listener(tf_buffer) {
//}
HdlLocalizationNodelet() {
}
//2.
// transform pointcloud into odom_child_frame_id
//pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>());
//if(!pcl_ros::transformPointCloud(odom_child_frame_id, *pcl_cloud, *cloud, this->tf_buffer)) {
// NODELET_ERROR("point cloud cannot be transformed into target frame!!");
// return;
//}
pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>());
if(!pcl_ros::transformPointCloud(odom_child_frame_id, *pcl_cloud, *cloud, this->tf_listener)) {
NODELET_ERROR("point cloud cannot be transformed into target frame!!");
return;
}
//3.
//tf2_ros::TransformListener tf_listener;
tf2_ros::TransformBroadcaster tf_broadcaster;
tf::TransformListener tf_listener;
|