Gazebo-Tutorial5(Build a World)
教程:http://gazebosim.org/tutorials?cat=build_world
1.概念解释
World:机器人和物体的集合(建筑、桌子、光等),以及一些全局参数,包括天空、环境光和物理属性等
Static:被标记为static的物体,只有碰撞属性
Dynamic:没有static标签的都为动态,具有惯性和碰撞属性
gazebo my_world.sdf :World保存可以使.world,也可以是.sdf
2.修改world
Scence Properties:可以改变周围环境和背景颜色
Physics Properties:可以改变一些物理属性,引力、求解器参数等
3.使用DEM(Digital Elevation Models, 数字高程模型)
目的:仿真地形
DEM是指用elevation data 来表示地形的3D图像显示方式,常用来表示行星表面,地球,月球
DSM(digital surface model),常用于景观建模,城市建模,可视化应用程序
DTM(digital terrain model),常用于洪水或者排水模型,土地使用研究
目前,gazebo只支持raster data,可以用GDAL转化 https://gdal.org/
gdalwarp -ts 129 129 -of ISIS2 /tmp/mtsthelens.dem /tmp/media/dem/mtsthelens_129.dem
这边修改dem文件的尺寸,需要使用gdal工具,这个工具默认的输出文件格式是GTIFF,所以需要-of ISIS2,官网例程中没有修改,跑不通,修改完即可。但是.tif也是一种DEM格式。
这个错误是因为model没有inertial导致的:
gzclient: /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/OgreMain/include/OgreAxisAlignedBox.h:252: void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&): Assertion `(min.x <= max.x && min.y <= max.y && min.z <= max.z) && "The minimum corner of the box must be less than or equal to maximum corner"' failed.
有时候打开太慢,是因为模型的原因(没有找到),使用下面的命令: GAZEBO_RESOURCE_PATH="$GAZEBO_RESOURCE_PATH:/tmp" gazebo /tmp/volcano.world
将多个.tif融合成一个.tif: gdal_merge.py *.tif -o dem_merged.tif
4.添加大量模型(a population of models)
一般用于数量多的无生命的物体,可以设置产生的范围,数量,类型(随机)等。
5.Building Editor的使用
可以从头开始画,也可以从2D图像导入(如雷达扫描的二维图像),可以配置尺寸。
最终保存为一个model文件
6.使用卫星图像作为地平面模型
这里用到了Google's Static Map API,所以需要连接到网络,使用其插件。需要申请秘钥什么的,比较麻烦

浙公网安备 33010602011771号