|
3 | 3 | * @Description: |
4 | 4 | * @Date: 2025-06-19 09:17:49 |
5 | 5 | * @LastEditors: yangjun_d 295967654@qq.com |
6 | | - * @LastEditTime: 2025-08-20 12:27:33 |
| 6 | + * @LastEditTime: 2025-08-21 00:24:16 |
7 | 7 | */ |
8 | 8 | #include"lio_node.h" |
9 | 9 | #include"utils/eigen_types.h" |
@@ -401,13 +401,13 @@ void LIO::Undistort() |
401 | 401 | scan_undistort_ = cloud; |
402 | 402 | // TODO: 需要解决scan_undistort_、cloud数据类型不匹配的问题; |
403 | 403 |
|
404 | | - sensor_msgs::PointCloud2 output; |
405 | | - pcl::toROSMsg( *cloud, output ); |
406 | | - output.header.frame_id = "map"; |
407 | | - // output.header.stamp = ros::Time::fromSec(LidarMeasures.lidar_frame_end_time); |
| 404 | + // sensor_msgs::PointCloud2 output; |
| 405 | + // pcl::toROSMsg( *cloud, output ); |
| 406 | + // output.header.frame_id = "map"; |
| 407 | + // // output.header.stamp = ros::Time::fromSec(LidarMeasures.lidar_frame_end_time); |
408 | 408 |
|
409 | | - // std::cout<<"360 frame id : "<< output.header.frame_id << endl; |
410 | | - pub_pcl_un.publish( output ); |
| 409 | + // // std::cout<<"360 frame id : "<< output.header.frame_id << endl; |
| 410 | + // pub_pcl_un.publish( output ); |
411 | 411 |
|
412 | 412 | } |
413 | 413 |
|
@@ -452,9 +452,18 @@ void LIO::Align() |
452 | 452 | CloudPtr current_scan_world(new PointCloudType); |
453 | 453 | // pcl::PointCloud<pcl::PointXYZINormal>::Ptr current_scan_world{new pcl::PointXYZINormal}; |
454 | 454 | pcl::transformPointCloud(*current_scan_filter, *current_scan_world, current_pose.matrix()); |
| 455 | + pcl::transformPointCloud(*scan_undistort_, *scan_undistort_, current_pose.matrix()); |
| 456 | + |
| 457 | + sensor_msgs::PointCloud2 output1; |
| 458 | + pcl::toROSMsg( *scan_undistort_, output1 ); |
| 459 | + output1.header.frame_id = "map"; |
| 460 | + // output.header.stamp = ros::Time::fromSec(LidarMeasures.lidar_frame_end_time); |
| 461 | + |
| 462 | + // std::cout<<"360 frame id : "<< output.header.frame_id << endl; |
| 463 | + pub_pcl_un.publish( output1 ); |
455 | 464 |
|
456 | 465 | *pcl_wait_save += *current_scan_world; |
457 | | - pcl::concatenate(*pcl_wait_save, *current_scan_world, *pcl_wait_save); |
| 466 | + // pcl::concatenate(*pcl_wait_save, *current_scan_world, *pcl_wait_save); |
458 | 467 |
|
459 | 468 | if (delta_pose.translation().norm() > 1.0 || delta_pose.so3().log().norm() > deg2rad(10.0)) { |
460 | 469 | // 将地图合入NDT中 |
|
0 commit comments