Skip to content

Commit 020fa1a

Browse files
committed
modified lio_node.cpp
1 parent 50c4b67 commit 020fa1a

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.vscode/
1+
.vscode/
2+
./Log/*

config/default.rviz

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Visualization Manager:
5555
- Alpha: 1
5656
Autocompute Intensity Bounds: true
5757
Autocompute Value Bounds:
58-
Max Value: 3.1102588176727295
59-
Min Value: -0.32467925548553467
58+
Max Value: 3.1373021602630615
59+
Min Value: -0.8680458664894104
6060
Value: true
6161
Axis: Z
6262
Channel Name: intensity
@@ -277,7 +277,7 @@ Visualization Manager:
277277
Axis: Z
278278
Channel Name: intensity
279279
Class: rviz/PointCloud2
280-
Color: 255; 32; 99
280+
Color: 15; 255; 143
281281
Color Transformer: FlatColor
282282
Decay Time: 0
283283
Enabled: true
@@ -290,8 +290,8 @@ Visualization Manager:
290290
Selectable: true
291291
Size (Pixels): 3
292292
Size (m): 0.03999999910593033
293-
Style: Flat Squares
294-
Topic: /mid360/ndt_clod
293+
Style: Boxes
294+
Topic: /mid360/undistort
295295
Unreliable: false
296296
Use Fixed Frame: true
297297
Use rainbow: true
@@ -324,25 +324,25 @@ Visualization Manager:
324324
Views:
325325
Current:
326326
Class: rviz/Orbit
327-
Distance: 23.09314727783203
327+
Distance: 31.872203826904297
328328
Enable Stereo Rendering:
329329
Stereo Eye Separation: 0.05999999865889549
330330
Stereo Focal Distance: 1
331331
Swap Stereo Eyes: false
332332
Value: false
333333
Field of View: 0.7853981852531433
334334
Focal Point:
335-
X: 5.736478805541992
336-
Y: -6.366806507110596
337-
Z: -2.820770025253296
335+
X: 8.03994369506836
336+
Y: 6.020419120788574
337+
Z: -2.2321622371673584
338338
Focal Shape Fixed Size: true
339339
Focal Shape Size: 0.05000000074505806
340340
Invert Z Axis: false
341341
Name: Current View
342342
Near Clip Distance: 0.009999999776482582
343-
Pitch: 0.22479748725891113
343+
Pitch: 0.7097973823547363
344344
Target Frame: <Fixed Frame>
345-
Yaw: 0.9625622630119324
345+
Yaw: 5.407115459442139
346346
Saved: ~
347347
Window Geometry:
348348
Displays:
@@ -363,4 +363,4 @@ Window Geometry:
363363
collapsed: false
364364
Width: 2457
365365
X: 280
366-
Y: 297
366+
Y: 223

src/lio_node.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Description:
44
* @Date: 2025-06-19 09:17:49
55
* @LastEditors: yangjun_d 295967654@qq.com
6-
* @LastEditTime: 2025-08-20 12:27:33
6+
* @LastEditTime: 2025-08-21 00:24:16
77
*/
88
#include"lio_node.h"
99
#include"utils/eigen_types.h"
@@ -401,13 +401,13 @@ void LIO::Undistort()
401401
scan_undistort_ = cloud;
402402
// TODO: 需要解决scan_undistort_、cloud数据类型不匹配的问题;
403403

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);
408408

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 );
411411

412412
}
413413

@@ -452,9 +452,18 @@ void LIO::Align()
452452
CloudPtr current_scan_world(new PointCloudType);
453453
// pcl::PointCloud<pcl::PointXYZINormal>::Ptr current_scan_world{new pcl::PointXYZINormal};
454454
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 );
455464

456465
*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);
458467

459468
if (delta_pose.translation().norm() > 1.0 || delta_pose.so3().log().norm() > deg2rad(10.0)) {
460469
// 将地图合入NDT中

0 commit comments

Comments
 (0)