学习的内容:
(1)创建HDL-32传感器的SDF文件模型
(2)将创建的模型应用到gazebo的模型库
(3)实现模型的显示和输出
(4)使用插件控制模型
(5)在gazebo和RViz中可视化模型

《一》模型的创建
模型:
(1)a base cylinder and top cylinder, where the top cylinder spins, and
(2)a set of laser rays oriented in the vertical fan.
step 1:创建world文件
选择一个文件夹,打开终端输入:gedit velodyne.world
在文件中输入以下内容:

    <?xml version="1.0" ?><sdf version="1.5"><world name="default"><!-- A global light source --><include><uri>model://sun</uri></include><!-- A ground plane --><include><uri>model://ground_plane</uri></include></world></sdf>
world文件的主要内容是设置地面和灯光。

step2:在world文件的标签前加入以下内容:

<model name="velodyne_hdl-32"><!-- Give the base link a unique name --><link name="base"><!-- Offset the base by half the lenght of the cylinder --><pose>0 0 0.029335 0 0 0</pose><collision name="base_collision"><geometry><cylinder><!-- Radius and length provided by Velodyne --><radius>.04267</radius><length>.05867</length></cylinder></geometry></collision><!-- The visual is mostly a copy of the collision --><visual name="base_visual"><geometry><cylinder><radius>.04267</radius><length>.05867</length></cylinder></geometry></visual></link><!-- Give the base link a unique name --><link name="top"><!-- Vertically offset the top cylinder by the length of the bottomcylinder and half the length of this cylinder. --><pose>0 0 0.095455 0 0 0</pose><collision name="top_collision"><geometry><cylinder><!-- Radius and length provided by Velodyne --><radius>0.04267</radius><length>0.07357</length></cylinder></geometry></collision><!-- The visual is mostly a copy of the collision --><visual name="top_visual"><geometry><cylinder><radius>0.04267</radius><length>0.07357</length></cylinder></geometry></visual></link>
</model>

step3:利用gazebo velodyne.world -u 看暂停仿真下的模型。

step4:在模型上加入惯性单元,实现对外力作用下的反应

<model name="velodyne_hdl-32"><link name="base"><pose>0 0 0.029335 0 0 0</pose><inertial><mass>1.2</mass><inertia><ixx>0.001087473</ixx><iyy>0.001087473</iyy><izz>0.001092437</izz><ixy>0</ixy><ixz>0</ixz><iyz>0</iyz></inertia></inertial>
 <link name="top"><pose>0 0 0.095455 0 0 0</pose><inertial><mass>0.1</mass><inertia><ixx>0.000090623</ixx><iyy>0.000090623</iyy><izz>0.000091036</izz><ixy>0</ixy><ixz>0</ixz><iyz>0</iyz></inertia></inertial>

step5:加入关节,在的前面加入以下内容:

<!-- Each joint must have a unique name -->
<joint type="revolute" name="joint"><!-- Position the joint at the bottom of the top link --><pose>0 0 -0.036785 0 0 0</pose><!-- Use the base link as the parent of the joint --><parent>base</parent><!-- Use the top link as the child of the joint --><child>top</child><!-- The axis defines the joint's degree of freedom --><axis><!-- Revolve around the z-axis --><xyz>0 0 1</xyz><!-- Limit refers to the range of motion of the joint --><limit><!-- Use a very large number to indicate a continuous revolution --><lower>-10000000000000000</lower><upper>10000000000000000</upper></limit></axis>
</joint>

step6:加入传感器,在这个模块中加入以下内容:;

<!-- Add a ray sensor, and give it a name -->
<sensor type="ray" name="sensor"><!-- Position the ray sensor based on the specification. Also rotateit by 90 degrees around the X-axis so that the <horizontal> raysbecome vertical --><pose>0 0 -0.004645 1.5707 0 0</pose><!-- Enable visualization to see the rays in the GUI --><visualize>true</visualize><!-- Set the update rate of the sensor --><update_rate>30</update_rate>
</sensor>

step7:定义ray的scan和rage,在sensor模块中的update_rate后面加入以下内容:

<ray><!-- The scan element contains the horizontal and vertical beams.We are leaving out the vertical beams for this tutorial. --><scan><!-- The horizontal beams --><horizontal><!-- The velodyne has 32 beams(samples) --><samples>32</samples><!-- Resolution is multiplied by samples to determine number ofsimulated beams vs interpolated beams. See:http://sdformat.org/spec?ver=1.6&elem=sensor#horizontal_resolution--><resolution>1</resolution><!-- Minimum angle in radians --><min_angle>-0.53529248</min_angle><!-- Maximum angle in radians --><max_angle>0.18622663</max_angle></horizontal></scan><!-- Range defines characteristics of an individual beam --><range><!-- Minimum distance of the beam --><min>0.05</min><!-- Maximum distance of the beam --><max>70</max><!-- Linear resolution of the beam --><resolution>0.02</resolution></range>
</ray>

仿真效果:

gazebo velodyne.world -u

点击开始仿真:
全部的模型代码:

<?xml version="1.0" ?>
<sdf version="1.5"><world name="default"><!-- A global light source -->
<include><uri>model://sun</uri>
</include><!-- A ground plane -->
<include><uri>model://ground_plane</uri>
</include><model name="velodyne_hdl-32"><!-- Give the base link a unique name --><link name="base"><!-- Offset the base by half the lenght of the cylinder --><pose>0 0 0.029335 0 0 0</pose><inertial><mass>1.2</mass><inertia><ixx>0.001087473</ixx><iyy>0.001087473</iyy><izz>0.001092437</izz><ixy>0</ixy><ixz>0</ixz><iyz>0</iyz></inertia></inertial><collision name="base_collision"><geometry><cylinder><!-- Radius and length provide by Velodyne --><radius>.04267</radius><length>.05867</length></cylinder></geometry></collision><!-- The visual is mostly a copy of the collision --><visual name="base_visual"><geometry><cylinder><radius>.04267</radius><length>.05867</length></cylinder></geometry></visual>
</link><link name="top"><!--Add a ray sensor,and give it a name -->
<sensor type="ray" name="sensor"><!-- Position the ray sensor based on the specifucation Also rotate it by 90 degrees around the x-axis so that the <horizontal> rays become wertical -->
<pose>0 0 -0.004645 1.5707 0 0</pose><!-- Enable visualization to see the rays in the GUI-->
<visualize>true</visualize><!--Set the update rate of the sensor-->
<update_rate>30</update_rate>
<ray><!-- The scan element contains the horizontal and vertiral beams. We are leaving out the vertical beams for this tutorial.-->
<scan><!--The horizontal beams-->
<horizontal><!--The velodyne has 32 beams(samples)-->
<samples>32</samples><!--Resolution is multiplited by sample to detemine number of simulated beams vs interpolated beams-->
<resolution>1</resolution><!--minimum angle in radians-->
<min_angle>-0.535299248</min_angle><!--maximum angle in radians -->
<max_angle>0.18622663</max_angle>
</horizontal>
</scan><!-- Range defines characteristics of an individual beam-->
<range><!--Minimum distance of the beam-->
<min>0.05</min><!--Maximum distance of the beam-->
<max>70</max><!--Linear resolution of the beam-->
<resolution>0.02</resolution>
</range>
</ray>
</sensor><!-- Vertically offset the top cylinder by the length of the bottomcylinder and half the length of this cylinder. --><pose>0 0 0.095455 0 0 0</pose><inertial><mass>0.1</mass><inertia><ixx>0.000090632</ixx><iyy>0.000090632</iyy><izz>0.000091036</izz><ixy>0</ixy><ixz>0</ixz><iyz>0</iyz></inertia>
</inertial><collision name="top_collision"><geometry><cylinder><!-- Radius and length provided by Velodyne --><radius>0.04267</radius><length>0.07357</length></cylinder></geometry></collision><!-- The visual is mostly a copy of the collision --><visual name="top_visual"><geometry><cylinder><radius>0.04267</radius><length>0.07357</length></cylinder></geometry></visual></link>
<!-- Each joint must have a unique name -->
<joint type="revolute" name="joint"><!--Position the joint at the bottom of the top link -->
<pose>0 0 -0.036785 0 0 0</pose><!--Use the base link as the parent of the joint -->
<parent>base</parent><!--Use the top link as the child of the joint -->
<child>top</child><!--The axis defines the joint`s degree of freedom -->
<axis><!--Revolve around the z-axis -->
<xyz>0 0 1</xyz><!--limit refers to the range of motion of the joint -->
<limit><!--Use a very large number to indicate a continuous revolution -->
<lower>-10000000000000000</lower>
<upper>10000000000000000</upper>
</limit>
</axis>
</joint>
</model>
</world>
</sdf>

gazebo仿真之Velodyne相关推荐

  1. 多线激光雷达+imu的gazebo仿真

    多线激光雷达+imu的gazebo仿真 前言:在做2D/3D slam的课题研究时,往往我们手里头没有昂贵的多线激光雷达和惯性传感器,ros提供了相应的传感器插件,通过插件可以在物理仿真环境下,模拟传 ...

  2. 【Autoware入门教程】如何在Gazebo仿真环境配置自动驾驶汽车

    假设你已经安装好了Autoware,Autoware源码中其实已经配置有Gazebo仿真环境,当然你也可以根据自己的需要另外下载自动驾驶汽车的仿真模型.该汽车模型已经默认配置好了Velodyne HD ...

  3. 【开源项目分享】用于机器人崎岖地形导航的高程图创建及Gazebo仿真

    简介 该项目是由苏黎世联邦理工学院(自治系统实验室和机器人系统实验室)开发,用于创建以机器人为中心的高程图,以实现崎岖地形的自主导航任务. 项目演示 https://www.bilibili.com/ ...

  4. 【从零开始的ROS四轴机械臂控制】(二) - ROS与Gazebo连接,Gazebo仿真及urdf文件修改

    [从零开始的ROS四轴机械臂控制(二)] 四.urdf文件及gazebo仿真 1.simple_arm示例 (1)config文件夹 (2)launch文件夹 (3)meshes文件夹 (4)urdf ...

  5. ROS笔记(18) Gazebo仿真

    ROS笔记(18) Gazebo仿真 1. 添加属性 2. 配置节点 3. 带传感器仿真 1. 添加属性 link添加<gezebo>标签 对于机器模型,需要对每个link添加<ge ...

  6. ROS+Gazebo仿真差速小车并实现控制

    本工程的功能包有两个,分别用于gazebo仿真与键盘控制运动 功能包原文件如下: diff_wheeled_robot_control : https://huffie.lanzouw.com/iXi ...

  7. 基于ROS搭建简易软件框架实现ROV水下目标跟踪(补1)--gazebo仿真

    项目地址:https://github.com/cabinx/cabin_auv_simulation 鉴于水下机器人调试的复杂性,在仿真环境中对水下机器人进行先期调试能降低调试难度,节约大量的时间成 ...

  8. gazebo仿真时在加入差分运动插件后没有cmd_vel话题

    一.问题描述: gazebo仿真时在加入差分运动插件后没有cmd_vel话题 joes@joes:~/jiao/ROS_Project$ roslaunch ros23_urdf02_gazebo d ...

  9. 通过Gazebo仿真学TurtleBot3(四)——简单的/cmd_vel控制

    1. 通过命令发送/cmd_vel控制底盘移动 - 启动tb3仿真: 启动: $ roslaunch tb3_sim_bringup tb3_empty_world.launch 开启rviz显示: ...

最新文章

  1. 一个c加一个g是什么牌子_一个G的流量60块钱,为什么会这么贵?
  2. 【以太坊】搭建测试网络之ubuntu系统安装geth客户端以及同步区块数据
  3. 《信息检索导论》第三章总结
  4. Pod详解-生命周期-容器探测
  5. Redis-3.2.4服务搭建
  6. mybatis返回map键值对_mybatis返回map key怎么指定
  7. 每年的飞鸽传书5月21日都要进一位老师
  8. 使用 docker+tmux 加强容器调度
  9. python如何对excel排序_Python操作Excel之分组排序
  10. python爬虫源代码_【Python每日一问】Python爬虫能做什么?
  11. [翻译svg教程]Path元素 svg中最神奇的元素!
  12. memcached(十)动态扩容
  13. 【优化算法】多目标哈里斯鹰优化算法(MOHHO)【含Matlab源码 1596期】
  14. NLP-语料库:英文语料库【Brown Corpus(有词性标注)、LOB(Lancaster-Oslo/Bergen,英国英文)...】
  15. “人人皆可成为AI开发者”!百度世界大会官宣百度松果学堂成立
  16. 【历史上的今天】7 月 23 日:Novell 挑战微软;计算机界的教育家出生;第一颗 Landsat 卫星发射
  17. Effect Size
  18. 终于有人把智慧城市和边缘计算说清楚了
  19. 定时且周期性的任务研究II--ScheduledThreadPoolExecutor
  20. 双向可控硅在交流调压电路中的使用

热门文章

  1. 生动理解java接口
  2. 可以玩所有游戏的计算机配置,什么样的电脑配置才可以玩各种3A巨作游戏?
  3. Html 和 CSS笔记
  4. SpringBoot安全登录验证
  5. Dynamics CRM IFD部署如何更换SSL证书
  6. IDEA 2021.2.3添加GitHub账户并提交代码到GitHub
  7. Intel服务器CPU背面信息,英特尔(Intel)服务器CPU全解析(图)
  8. 百度网盘PC端登录安全验证显示空白页
  9. linux普通用户密码到期修改为原密码方法
  10. C++如何写一个函数