机器人SDF模型写法官方例子
机器人SDF模型写法官方例子
- SDF
- link
- Collision
- visual
- joint
- sensor
- world
参考:SDFormat官方,里面会写有有什么元素<>可以写
SDF
<?xml version='1.0'?>
<sdf version='1.12'>
<world name='default'>
...
</world>
</sdf>
or
<?xml version='1.0'?>
<sdf version='1.12'>
<model name='my_model'>
...
</model>
</sdf>
or
<?xml version='1.0'?>
<sdf version='1.12'>
<actor name='my_actor'>
...
</actor>
</sdf>
or
<?xml version='1.0'?>
<sdf version='1.12'>
<light name='my_light'>
...
</light>
</sdf>
link
<?xml version="1.0" ?>
<sdf version="1.5">
<model name="box">
<pose>0 0 0.5 0 0 0</pose>
<static>false</static>
<link name="link">
<pose>0 0 0 0 0 0</pose>
<inertial>
<inertia>
<ixx>1</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>1</iyy>
<iyz>0</iyz>
<izz>1</izz>
</inertia>
<mass>1.0</mass>
</inertial>
<collision name="my_collision">
...
</collision>
<visual name="my_visual">
...
</visual>
<sensor type="camera" name="my_sensor">
...
</sensor>
</link>
</model>
</sdf>
Collision
还有< surface>其中包括了< friction>,< bounce>,< contact>, < soft_contact>
<collision name="collision">
<pose>0 0 0.5 0 0 0</pose>
<geometry>
<box>
<size>1 1 1</size>
</box>
</geometry>
</collision>
visual
material等等
<visual name="visual">
<pose>0 0 0.5 0 0 0</pose>
<geometry>
<box>
<size>1 1 1</size>
</box>
</geometry>
</visual>
joint
<?xml version="1.0" ?>
<sdf version="1.5">
<model name="box">
<link name="link_1">
...
</link>
<link name="link_2">
...
</link>
<joint name="bar_12_joint" type="revolute">
<parent>link_1</parent>
<child>link_2</child>
<pose>0 0.5 0 0 0 0</pose>
<axis>
<xyz>0 0 1</xyz>
</axis>
</joint>
</model>
</sdf>
sensor
<?xml version="1.0" ?>
<sdf version="1.5">
<model name="box">
<link name="link">
<sensor type="camera" name="my_sensor">
<camera>
<horizontal_fov>1.047</horizontal_fov>
<image>
<width>320</width>
<height>240</height>
</image>
<clip>
<near>0.1</near>
<far>100</far>
</clip>
</camera>
<always_on>1</always_on>
<update_rate>30</update_rate>
<visualize>true</visualize>
</sensor>
</link>
</model>
</sdf>
world
< wind>、< gravity>、< magnetic_field>、< atmosphere>、< gui>、< physics>等等
<?xml version="1.0" ?>
<sdf version="1.5">
<world name="default">
<physics type="ode">
...
</physics>
<scene>
...
</scene>
<model name="box">
...
</model>
<model name="sphere">
...
</model>
<light name="spotlight">
...
</light>
</world>
</sdf>