ROS学习系列:第四讲 — gazebo模型建立

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

  1. 点击joint按钮,弹出对话框。
  2. 调整相应的参数即可。

在这里插入图片描述

Edit Links

可以编辑在其SDF文件中发现的那些连接的属性。
为了编辑Link的属性,双击link或者右键link选择Open Link Inspector,对话框包含:LinkVisualCollision属性。
在这里插入图片描述

Edit joints

为了编辑joint:双击连接线或者右键连接线选择Open Joint Inspector
在这里插入图片描述

保存模型

保存可以为你的模型创建目录、SDF和配置文件。

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值