ROS学习--UDRF

学习资料来源

http://www.360doc.com/content/16/0812/18/7821691_582768083.shtml

定义

Unified Robot Description Format,统一机器人描述格式,简称为URDF。ROS中的urdf功能包包含一个URDF的C++解析器,URDF文件使用XML格式描述机器人模型。

格式

具体参见
http://wiki.ros.org/urdf/XML

节点描述如下

1、sensor/proposals
Describes a sensor, such as a camera, ray sensor, etc
描述了一个传感器,如相机、光线传感器等
2、link
Describes the kinematic and dynamic properties of a link.
描述一个链接的动态和动态属性。
3、transmission
Transmissions link actuators to joints and represents their mechanical coupling
变速器将执行器连接到接头并表示它们的机械耦合
4、joint
Describes the kinematic and dynamic properties of a joint.
介绍了关节的运动学和动力学特性。
5、gazebo
Describes simulation properties, such as damping, friction, etc
描述仿真属性,如阻尼、摩擦等
6、sensor
Describes a sensor, such as a camera, ray sensor, etc
描述了一个传感器,如相机、光线传感器等
7、model_state
Describes the state of a model at a certain time
在一定时间内描述模型的状态
8、model
Describes the kinematic and dynamic properties of a robot structure.
描述了机器人结构的运动学和动力学特性。

语法检查工具

ROS提供了一个工具来检查我们UDRF的正确性。首先获取我们的工具。

sudo apt-get install liburdfdom-tools

安装完毕后,执行检查

check_urdf my_robot.urdf

如果一切正常,将会有如下显示:

robot name is: test_robot
———- Successfully Parsed XML —————
root Link: link1 has 2 child(ren)
child(1): link2
child(2): link3
child(1): link4

语法格式正式开讲

一个小Demo

<robot name="test_robot">
  <link name="link1" />
  <link name="link2" />
  <link name="link3" />
  <link name="link4" />

  <joint name="joint1" type="continuous">
    <parent link="link1"/>
    <child link="link2"/>
  </joint>

  <joint name="joint2" type="continuous">
    <parent link="link1"/>
    <child link="link3"/>
  </joint>

  <joint name="joint3" type="continuous">
    <parent link="link3"/>
    <child link="link4"/>
  </joint>
</robot>

这里是图片描述

按照骨骼动画进行了解,Link表示的是骨骼,Joint表示的是关节,骨骼在关节的作用下回体现出父子关系。

Joint的描述

origin

这里写图片描述

在基础模型之上,我们为机器人添加尺寸大小。由于每个环节的参考系都位于该环节的底部,关节也是如此,所以在表示尺寸大小时,只需要描述其相对于连接的关节的相对位置关系即可。URDF中的域就是用来表示这种相对关系。
例如,joint2相对于连接的link1在x轴和y轴都有相对位移,而且在x轴上还有90度的旋转变换,所以表示成<origin>域的参数就如下所示:

<origin xyz="-2 5 0" rpy="0 0 1.57" />

没看懂,具体数字对应不起来

axis

如果我们为机器人的关节添加旋转轴参数,那么该机器人模型就可以具备基本的运动学参数。
例如,joint2围绕正y轴旋转,可以表示成:

<axis xyz="0 1 0" />

axis旋转起来的坐标系应该是什么样子的呢

最后我们生成了一个相对复杂的UDRF,看是否能理解

<robot name="test_robot">
  <link name="link1" />
  <link name="link2" />
  <link name="link3" />
  <link name="link4" />

  <joint name="joint1" type="continuous">
    <parent link="link1"/>
    <child link="link2"/>
    <origin xyz="5 3 0" rpy="0 0 0" />
    <axis xyz="-0.9 0.15 0" />
  </joint>

  <joint name="joint2" type="continuous">
    <parent link="link1"/>
    <child link="link3"/>
    <origin xyz="-2 5 0" rpy="0 0 1.57" />
    <axis xyz="-0.707 0.707 0" />
  </joint>

  <joint name="joint3" type="continuous">
    <parent link="link3"/>
    <child link="link4"/>
    <origin xyz="5 0 0" rpy="0 0 -1.57" />
    <axis xyz="0.707 -0.707 0" />
  </joint>
</robot>

图形化显示UDRF

ROS提供了工具可以进行图形化显示

urdf_to_graphiz my_robot.urdf

生成后的结果变成
这里写图片描述

最后附上官网的UDRF例子

http://wiki.ros.org/urdf/Examples

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值