环境:ubuntu16 + ros kinetic
建立工作环境
$ mkdir -p ~/turtlebot_ws/src
$ cd ~/turtlebot_ws/src
## 激光雷达rplidar一代驱动
$ git clone https://github.com/ncnynl/rplidar_ros.git
~$ cd catkin_ws/
~/catkin_ws$ catkin_make
添加环境变量,在~/.bashrc最后添加一行:
$ source ~/turtlebot_ws/devel/setup.bash(自己的路径)
配置刷新
source ~/.bashrc
插上激光雷达
检查端口并设置权限、
$ ls -l /dev |grep ttyUSB
$ sudo chmod 666 /dev/ttyUSB0(具体看查看的结果)
运行测试
$ roslaunch rplidar_ros view_rplidar.launch
运行rplidar和查看测试应用
$ roslaunch rplidar_ros rplidar.launch
# 新终端打开
$ rosrun rplidar_ros rplidarNodeClient