16线激光雷达3Dslam建图算法BLAM使⽤简介:
LiDAR-bad real-time 3D localization and mapping
⼀、安装依赖包
1、安装ROS
2、安装
sudo apt-get install libboost-all-dev
sudo apt-get install cmake
git clone bitbucket/gtborg/gtsam.git
cd gtsam
mkdir build
cd build
hostagescmake ..
sudo make install
⼆、安装BLAM
git /erik-nelson/blam.git
cd blam
conveying
./update
常见问题
accumulate
1、fatal error: ros/ros.h: No such file or directory
cd blam/internal/src/geometry_utils
l
#添加⼀下内容
<build_depend>roscpp</build_depend>
<run_depend>roscpp</run_depend>
tsp
#修改find_package(catkin REQUIRED)为residents
find_package(catkin REQUIRED COMPONENTS roscpp)
#添加
cabinet是什么意思include_directories(include ${catkin_INCLUDE_DIRS})
2、Invalid (NaN, Inf) point coordinates given to nearestKSearch!
erectpcl中NaN数据处理
在blam/src/point_cloud_filter/src/PointCloudFilter的filter函数最后⾯添加如下内容
if (!points->is_den)
{
points_filtered->is_den = fal;
std::vector<int> indices;
pcl::removeNaNFromPointCloud(*points_filtered,*points_filtered, indices);
}
以上nan问题主要是因为所使⽤的点云数据is_desne:fal也就是说,点云⾥⾯可能含有nan所以在filter⾥⾯统⼀做了去除⽆效值
3、按照以上⽅法修改后,在回环后还是出现Invalid (NaN, Inf) point coordinates given to nearestKSearch
修改”BlamSlam”,修改以下⼏⾏(这⼏⾏不是连在⼀起的),即把使⽤原始msg的地⽅替换为msg_filtered
//1、change loop_closure_.AddKeyScanPair(0, msg); to
loop_closure_.AddKeyScanPair(0, msg_filtered);
//2、change if (HandleLoopClosures(msg, &new_keyframe)) to
if (HandleLoopClosures(msg_filtered, &new_keyframe))
//3、localization_.TransformPointsToFixedFrame(*msg, ());
localization_.TransformPointsToFixedFrame(*msg_filtered, ());
三、使⽤
使⽤⾃⼰的数据集,修改test_online.launch⽂件
<remap from="~pcld" to="/rslidar_points"/> <!--/rslidar_points替换成⾃⼰的话题名-->
roslaunch rslidar rslidar_16.launch //运⾏激光雷达
source your_path/blam-master/internal/devel/tup.zsh//或./workon
roslaunch blam_example test_online.launch
使⽤⾃定义数据集常见问题
1、效果不好
点云数量少就修改point_cloud_filter/config/parameters.yaml
#关闭voxel grid filter
grid_filter: fal
2、按照1修改了,效果还不好,旋转特别⼤
修改point_cloud_localization/config/parameters.yaml
# Maximum acceptable incremental rotation and translation.
transform_thresholding: true #fal
max_translation: 0.5 #0.05
max_rotation: 0.3 #0.1
3、不回环
观察你的po相差多远,修改lar_loop_closure/config/parameters.yaml
#默认0.5⽶检测⼀次回环或记录关键帧,值越⼤效率越⾼,发现构图缓慢的时候可以放⼤这个值translation_threshold: 1.0 #0.5
#默认是在1.5⽶范围内匹配,根据你⾃⼰的回环误差放⼤这个值
proximity_threshold: 10 #1.5
旅游胜地英文#ICP "fitness score" must be less than this number,就是越⼩越难回环
max_tolerable_fitness: 5 #0.15
西安英语家教#根据你⾃⼰的地图⼤⼩适当放宽跳过回环的点数,⼀般地图越⼤值越⼤
skip_recent_pos: 100 #40
pos_before_reclosing: 100 #40
4. rviz查看
rosrun rviz rviz -d blam_example/rviz/lidar_slam.rviz
参考博客
>初中英语单词表