最近在学习使用激光雷达跑Cartographer,手上的激光雷达是北阳hokuyo UST-20LX,端口为网口。
下面安装激光雷达,主要参考博客https://blog.youkuaiyun.com/hongliang2009/article/details/73302986
端口为网口的激光雷达需要安装的是urg_node,端口为USB口的如UST-30LX则需要安装hokuyo_node。
我们这里安装urg_node
1、安装driver_base
cd ~/catkin_ws/src/
mkdir hokuyo
cd hokuyo
git clone https://github.com/ros-drivers/driver_common.git
cd ~/catkin_ws/src/hokuyo/driver_common/driver_base/
mkdir build
cd build
cmake ..
make
sudo make install
cd ~/catkin_ws/src/hokuyo/driver_common/driver_common/
mkdir build
cd build
cmake ..
make
sudo make install
cd ~/catkin_ws/src/hokuyo/driver_common/timestamp_tools/
mkdir build
cd build
cmake ..
make
sudo make install
我在第一个sudo make install时报错(ImportError: No module named genmsg),解决方法
export PYTHONPATH=/opt/ros/kinetic/lib/python2.7/dist-packages/
然后把这一层的build里的东西删掉重新cmake。具体可以看https://stackoverflow.com/questions/39281644/ros2-importerror-no-module-named-genmsg
2、安装urg_