硬件:Hokuyo URG-04LX-UG01
OS: ROS indigo
$ sudo apt-get installros-indigo-hokuyo-node //安装hokuyo串口驱动
$ sudo apt-get installros-indigo-hector-slam //安装hector_slam
然后编写接收scan topic的hector_slam launch文件
tutorial.launch
//要把odom值换成base_frame,这样就不需要odemetry,不然会报错
编写完成后,运行:
$ roscore
打开另一个终端
$ source ~/catkin_ws/devel/setup.bash
$ rosrun hokuyo_node hokuyo_node
如果出错提示串口没有打开‘运行
$ sudo chmod a+rw /dev/ttyACM0
再运行以下命令行
$ls -l /dev/ttyACM0
出现以下信息则没问题了
·crw-rw-rw- 1 root dialout 166, 02009-10-27 14:18 /dev/ttyACM0
打开另一个终端
$ source ~/catkin_ws/devel/setup.bash
$ roslaunch laser tutorial.launch