1 下载VLP16的模型描述文件
在这个网站上进行下载:
Bitbuckethttps://bitbucket.org/DataspeedInc/velodyne_simulator/src/master/ 使用 URDF 描述和 Gazebo 插件来模拟 Velodyne 激光扫描仪!
下图是一个官方给的效果。
- URDF with colored meshes
- Gazebo plugin based on gazebo_plugins/gazebo_ros_block_laser
- Publishes PointCloud2 with same structure (x, y, z, intensity, ring, time)
- Simulated Gaussian noise
- GPU acceleration (with a modern Gazebo build)
- Supported models:
- Experimental support for clipping low-intensity returns
可以看到,它和VLP16现实一样,都有XYZIRT信息,并且添加了高斯噪声,还能提供GPU加速。
2 VLP16的描述文件
我们打开下载好的仿真,把velodyne_simulator下面的velodyne_description的VLP-16.urdf.xacro复制到我们的项目中(参考上篇博客,复制到xacro文件夹中)
如下:
我们不能直接用,需要去修改一些参数:
1、把*origin删掉,不然与<xacro:insert_block name=“origin” /> 一起,会造成报错:“Not enough blocks”。
2、把joint删掉,在总xacro文件中声明joint即可,不用重复声明。
3、把parent:=base_link改为自己的机器人link名字,不然又报错。
VLP-16.urdf.xacro文件中有关于激光雷达仿真部分的描述如下:
*origin
URDF transform from parent link.parent
URDF parent link name. Defaultbase_link
name
URDF model name. Also used as tf frame_id for PointCloud2 output. Defaultvelodyne
topic
PointCloud2 output topic name. Default/velodyne_points
hz
Update rate in hz. Default10
lasers
Number of vertical spinning lasers. DefaultVLP-16: 16, HDL-32E: 32
samples
Nuber of horizontal rotating samples. DefaultVLP-16: 1875, HDL-32E: 2187
organize_cloud
Organize PointCloud2 into 2D array with NaN placeholders, otherwise 1D array and leave out invlaid points. Defaultfalse
min_range
Minimum range value in meters. Default0.9
max_range
Maximum range value in meters. Default130.0
noise
Gausian noise value in meters. Default0.008
min_angle
Minimum horizontal angle in radians. Default-3.14
max_angle
Maximum horizontal angle in radians. Default3.14
gpu
Use gpu_ray sensor instead of the standard ray sensor. Defaultfalse
min_intensity
The minimum intensity beneath which returns will be clipped. Can be used to remove low-intensity objects.
2