缓存点云消息,转换成pcl类型点云,记录时间戳,去除无效点
| 167 | |
| 168 | // 缓存点云消息,转换成pcl类型点云,记录时间戳,去除无效点 |
| 169 | bool cachePointCloud(const faster_lio_sam::merge_cloud::ConstPtr& laserCloudMsg) |
| 170 | { |
| 171 | // cache point cloud |
| 172 | cloudQueue.push_back(*laserCloudMsg); |
| 173 | if(cloudQueue.size()<=1) |
| 174 | return false; |
| 175 | |
| 176 | // convert cloud |
| 177 | currentCloudMsg = cloudQueue.front(); |
| 178 | cloudQueue.pop_front(); |
| 179 | pcl::fromROSMsg(currentCloudMsg.merge_cloud, *laserCloudIn); |
| 180 | |
| 181 | // get timestamp |
| 182 | cloudHeader = currentCloudMsg.header; |
| 183 | // 该点云帧第一个点的时间戳 |
| 184 | timeScanCur = cloudHeader.stamp.toSec(); |
| 185 | // 该点云帧最后一个点的时间戳 |
| 186 | timeScanEnd = currentCloudMsg.scanEndTime; |
| 187 | |
| 188 | // cout<<laserCloudIn->size()<<endl; |
| 189 | |
| 190 | return true; |
| 191 | } |
| 192 | |
| 193 | // 根据IMU pose和IMU odometry,提前计算整帧点云的去畸变参数,在projectPointCloud会根据时间偏移量校正每个点 |
| 194 | bool deskewInfo() |