注意:
为了能和读者进一步讨论问题,建立了一个微信群,方便给大家解答问题,也可以一起讨论问题。
加群链接
webots版本:2020b rev1
ros版本:melodic
在webots中官方给我们提供了多种雷达(有2D雷达和3D雷达)
这里我们用到的是SickLms291
扫描范围:1800
角度分辨率:0.25 … 10
分辨率:10mm
系统误差:+/-35mm(mm为单位), +/-5cm(cm为单位)
统计误差:10mm(mm为单位)
Robot->children
下添加PROTO nodes—>devices->sick->SickLms291(lidar)
雷达坐标
rosservice list
$ rosservice call /robot/Sick_LMS_291/enable "value: 1"
success: True
$ rostopic list
可以看到雷达发布了两个主题:
/robot/Sick_LMS_291/laser_scan/layer0
/robot/Sick_LMS_291/range_image
/robot/Sick_LMS_291/laser_scan/layer0
消息类型$ rostopic type /robot/Sick_LMS_291/laser_scan/layer0
sensor_msgs/LaserScan
$ rosmsg show sensor_msgs/LaserScan
$ rostopic echo /robot/Sick_LMS_291/laser_scan/layer0
---
header:
seq: 25796
stamp:
secs: 1610417466
nsecs: 836696320
frame_id: "robot/Sick_LMS_291"
angle_min: -1.5707950592
angle_max: 1.5707950592
angle_increment: 0.0174532774836
time_increment: 5.55555561732e-06
scan_time: 0.0010000000475
range_min: 0.00999999977648
range_max: 80.0
ranges: [80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 40.593505859375, 1.7109997272491455, 1.747383713722229, 42.924434661865234, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 2.1447083950042725, 1.8642678260803223, 2.059617757797241, 51.29610824584961, 80.0, 2.1025097370147705, 2.0608510971069336, 2.2517471313476562, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0]
intensities: []
---
这些数据很难被人理解,想要更好的理解数据的含义,最好的方法就是使用rviz在图形化界面下展示数据。
$ rviz
加载LaserScan和Image显示类型。
LaserScan下将Topic改成/robot/Sick_LMS_291/laser_scan/layer0
Image下将Topic改成/robot/Sick_LMS_291/range_image
并且需要将Fixed Frame改成robot/Sick_LMS_291
才能正确显示数据
可以看到/robot/Sick_LMS_291/laser_scan/layer0
和/robot/Sick_LMS_291/range_image
已经成功显示出了前方的障碍物
本文也是基于笔者的学习和使用经验总结的,主观性较强,如果有哪些不对的地方或者不明白的地方,欢迎评论区留言交流~
下一节开启导航之旅。
✌Bye