gazebo模型元素
World Files
文件包含机器人、灯光、传感器、静态物体。文件格式SDF,后缀扩展名.world
。
gazebo服务端gzserver
读取world文件产生和构成world。
Model Files
文件格式SDF,但是仅仅包含标签<model> ... </model>
。目的是提高模型文件的复用性,并简化world文件。
world文件包含model文件:官方提供了很多关于model的数据集。
<include>
<uri>model://model_file_name</uri>
</include>
环境变量
通常使用:source <install_path>/share/gazebo/setup.sh
。
Capture screenshots
保存位置:~/.gazebo/pictures
Model Database Structure 模型数据库结构
- Database 数据库根目录
- database.config : Meta data about the database. This is now populated automatically from CMakeLists.txt 数据库配置文件仅仅在线存储时被需要,离线存储的模型不需要数据库配置文件。
- model_1 : A directory for model_1 模型根目录,模型在数据库中具有唯一性
- model.config : Meta-data about model_1
- model.sdf : SDF description of the model
- model.sdf.erb : Ruby embedded SDF model description
- meshes : A directory for all COLLADA and STL files
- materials : A directory which should only contain the textures and scripts subdirectories
- textures : A directory for image files (jpg, png, etc).
- scripts : A directory for OGRE material scripts
- plugins: A directory for plugin source and header files
Make a Model
SDF Modelsde 元素
Links:模型本体的物理属性。
- Collision:碰撞
- Visual:可视化元素
- Inertial:惯性
- Sensor:
- Light:
Joints:两个链接Links之间的关节,包含从属关系、坐标、约束
Plugins:第三方动态库用于控制模型
注:通常很少会自己手写SDF文件创建模型,通常使用Model Editor。
Add a Sensor to a Robot 在机器人上增加传感器
通过标签和连接复合模型的不同部分。
在原始的SDF文件中,插入雷达laser:
<include>
<uri>model://hokuyo</uri>
<pose>0.2 0 0.2 0 0 0</pose>
</include>
<joint name="hokuyo_joint" type="fixed">
<child>hokuyo::link</child>
<parent>chassis</parent>
</joint>
告诉gazebo找到模型,并按照与父模型pose位姿插入到父模型中。
连接laser和机器人,代表两个模型之间的移动约束。
名字来源于雷达模型文件:
<?xml version="1.0" ?>
<sdf version="1.4">
<model name="hokuyo">
<link name="link">
本讲重点:Model Editor
Add Links
将模型数据库中需要的Models添加到3D View窗口,然后对需要添加Meshes的Links添加Meshes。
** Gazebo 8 supports COLLADA (.dae), 3D Systems (.stl), Wavefront (.obj) and W3C SVG (.svg) files.**
Create Joints
- 点击
joint
按钮,弹出对话框。 - 调整相应的参数即可。
Edit Links
可以编辑在其SDF文件中发现的那些连接的属性。
为了编辑Link的属性,双击link或者右键link选择Open Link Inspector
,对话框包含:Link
、Visual
、Collision
属性。
Edit joints
为了编辑joint:双击连接线或者右键连接线选择Open Joint Inspector
。
保存模型
保存可以为你的模型创建目录、SDF和配置文件。