Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3053293
  • 博文数量: 396
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 4209
  • 用 户 组: 普通用户
  • 注册时间: 2016-07-04 13:04
文章分类

全部博文(396)

文章存档

2022年(1)

2021年(2)

2020年(8)

2019年(24)

2018年(135)

2017年(158)

2016年(68)

我的朋友

分类: 嵌入式

2018-07-30 14:44:42

定义

Unified Robot Description Format,统一机器人描述格式,简称为URDF。ROS中的urdf功能包包含一个URDF的C++解析器,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>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

这里是图片描述

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

Joint的描述

origin

这里写图片描述

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

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

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

axis

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

<axis xyz="0 1 0" /> 
  • 1

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>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27

图形化显示UDRF

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

urdf_to_graphiz my_robot.urdf

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

最后附上官网的UDRF例子

阅读(1664) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~