整个过程参考了创客智造的教程:
https://www.ncnynl.com/archives/201611/1097.html
我根据自己设备的情况进行了改变
1. 准备
主机: Intel NUC, 安装ubuntu 14.04和ROS indigo
底盘:turtlebot2
激光雷达:hokuyo
hokuyo驱动:$ git clone https://github.com/ncnynl/hokuyo_node.git
turtlebot依赖包:$ git clone https://github.com/turtlebot/turtlebot_apps
gmapping包:$ git clone https://github.com/ros-perception/slam_gmapping.git
clone到工作空间并catkin_make
,
刷新配置:$ rospack profile
2. 测试hokuyo
$ roslaunch hokuyo_node hokuyo_test.launch
运行hokuyo驱动后应该没有error,使用$ rostopic list
检查:
/diagnostics
/hokuyo/parameter_descriptions
/hokuyo/parameter_updates
/rosout
/rosout_agg
/scan
还可以使用rviz检查下,laser节点应该是正常的
注意hokuyo_test.launch
里需要hokuyo的串口ID:
<!-- Set the port to connect to here -->
<param name="port" type="string" value="/dev/ttyACM0"/>
一般情况下默认的/dev/ttyACM0
就可以,不确定的话可以用$ dmesg | grep tty
查看:
[ 0.000000] console [tty0] enabled
[ 2.071919] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
[ 2.075799] cdc_acm 2-2:1.0: ttyACM0: USB ACM device
也可以使用$ lsusb
查看:
Bus 001 Device 002: ID 8087:8001 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002