1、新建空白墙的模型
在gazebo中添加一个Edit->Building Editor,生成sdf文件,放在~/.gazebo/models文件夹下
如图Untitled1
编辑model.sdf文件,重点是material下面几行代码,
代码在文末!
在文末!
在文末!
2、添加二维码图片:
二维码图片(png格式)
将二维码图片保存到/materials/textures中
以其中一张二维码图片名称aruco-1为例
3、修改墙体模型表面材料:
materials/scripts中新建aruco.material
import * from "grid.material"
material Gazebo/aruco-1
{
receive_shadows on
technique
{
pass
{
ambient 0.5 0.5 0.5 1.000000
texture_unit
{
texture aruco-1.png
}
}
}
}
4、打开gazebo插入模型Untitled1:
参考:gazebo model库中beer
代码:model.sdf
<?xml version='1.0'?>
<sdf version='1.7'>
<model name='Untitled1'>
<pose>-1.66123 0.5775 0 0 -0 0</pose>
<link name='Wall_8'>
<collision name='Wall_8_Collision'>
<geometry>
<box>
<size>2.5 0.15 2.5</size>
</box>
</geometry>
<pose>0 0 1.25 0 -0 0</pose>
</collision>
<visual name='Wall_8_Visual'>
<pose>0 0 1.25 0 -0 0</pose>
<geometry>
<box>
<size>2.5 0.15 2.5</size>
</box>
</geometry>
<material>
<script>
<uri>model:
<uri>model:
<name>Gazebo/aruco-1</name>
</script>
<ambient>1 1 1 1</ambient>
</material>
<meta>
<layer>0</layer>
</meta>
</visual>
<pose>-0.541194 0 0 0 -0 0.523599</pose>
</link>
<static>1</static>
</model>
</sdf>
参考视频:https://youtu.be/WDhIaVOUwsk(油管)
https://answers.ros.org/question/240392/add-ar-tag-in-gazebo/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)