1.环境配置
Ubuntu:18.04 ros: melodic sick : LMS151
2.安装
#安装依赖 sudo apt-get install ros-noetic-lms1xx #下载源码并编译 cd ~/catkin_ws/src git clone https://github.com/clearpathrobotics/lms1xx.git cd .. catkin_make
3.保持Ubuntu 该系统与雷达具有相同的网段ping通
LMS151 IP: 192.168.0.1 Ubuntu 有线连接IP: 192.168.0.xx (2-254)
4.运行测试
#修改LMS1xx.launch文件中的"host"值为LMS151 IP,并保存 <arg name="host" default="192.168.0.1" /> #保存启动launch文件 roslaunch lms1xx LMS1xx.launch
报错:
查看源码 ,LMS1xx_node.cpp中75-81行
if (cfg.scaningFrequency != 5000) # 值修改为2500 { laser.disconnect(); ROS_WARN("Unable to get laser output range. Retrying."); ros::Duration(1).sleep(); continue; }
原因:当前雷达的真实扫描频率值为2500,不是5000,修改cfg.scaningFrequency != 2500,重新编译。雷达的扫描频率值可以通过SOPAS Engineering Tool 查看工具。windows 接入西克激光LMS151
5.可视化显示rviz 6. /scan话题
seq 在发布消息时,是消息的顺序标识发布节点,会自动累加 stamp 与数据相关的时间戳 frame_id 信息中与数据相关的参考系id angle_min 起始角度(rad) angle_max 结束角度(rad) angle_increment 角度分辨率(rad) time_increment 每个角度扫描时间 scan_time 扫描间隔 range_min 最小距离 range_max 最大距离 ranges 距离各个角度 intensities 各角度的强度
有任何问题欢迎咨询~~