参考文章:
https://www.ncnynl.com/archives/201611/1100.html
https://blog.csdn.net/weixin_41459903/article/details/102795148
构建ros文件夹
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
安装激光雷达rplidar一代驱动
git clone https://github.com/ncnynl/rplidar_ros.git
cd ..
catkin_make
一、点云图测试
##开启串口权限
sudo chmod 777 /dev/ttyUSB0
roslaunch rplidar_ros view_rplidar.launch
二、slam建图测试
sudo apt-get install ros-melodic-hector-slam
(如果报错就按报错提示更新 sudo apt-get update)
(如果更新报错就更新ros安装密匙)
cd到刚才下载的功能包下面(cd ~/catkin_ws/src/rplidar_ros)
touch test.launch
把下面的内容复制到test.launch中
<launch>
<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
<!-- Frame names -->
<param name="pub_map_odom_transform" value="true"/>