文章目录
- 前言
- 一、功能作用说明
- URDF
- SRDF
- 二、样例文件说明
- URDF文件例子
- SRDF文件例子
- 总结
前言
URDF全称为Unified Robot Description Format,中文可以翻译为“统一机器人描述格式”。与计算机文件中的.txt文本格式、.jpg图像格式等类似,URDF是一种基于XML规范、用于描述机器人结构的格式。
SRDF, 全称为Semantic Robot Description Format,是MoveIt针对控制机器人关节运动使用的一种机器人描述文件格式。
一、功能作用说明
URDF
URDF(Unified Robot Description Format)设计这一格式的目的在于提供一种尽可能通用的机器人描述规范。从机构学角度讲,机器人通常被建模为由连杆和关节组成的结构。连杆是带有质量属性的刚体,而关节是连接、限制两个刚体相对运动的结构。关节也被成为运动副。通过关节将连杆依次连接起来,就构成了一个个运动链(也就是这里所定义的机器人模型)。一个URDF文档即描述了这样的一系列关节与连杆的相对关系、惯性属性、几何特点和碰撞模型。具体来说,包括 :
- 机器人模型的运动学与动力学描述
- 机器人的几何表示
- 机器人的碰撞模型
SRDF
SRDF(Semantic Robot Description Format)它基于URDF对机器人的描述,对以下内容进行定义:
- 关节组 joint groups
- 默认状态配置 default robot configurations
- 额外的碰撞检测信息 additional collision checking information
- 额外的坐标系变换 additional transforms (使得可以完全的定义机器人的姿态)
可以使用MoveIt提供的配置助手MoveIt Setup Assistant生成SDRF文件,前提是有一个完整的URDF文件。
二、样例文件说明
URDF文件例子
其中<joint name="panda_joint1" type="revolute">
的type有以下几种,内容是:
- continuous: 一个不受限制的, 绕着一根轴的转动副.
- revolute: 一个转动角度受到限制的, 绕着一根轴的转动副.
- prismatic: 一个沿着一根轴的滑动副, 并且有限位.
- fixed: 固定关节.
- floating: 这个关节允许六个自由度的运动, 浮动关节.
panda.urdf
文件,用来描述panda机械手的视觉及干涉模型,各个轴之间的连接关系,各个连接的运动方式。
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from /opt/ros/kinetic/share/moveit_resources/panda_description/urdf/panda.urdf | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="panda" xmlns:xacro="http://www.ros.org/wiki/xacro">
<link name="panda_link0">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/link0.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/link0.stl" />
</geometry>
</collision>
</link>
<link name="panda_link1">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/link1.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/link1.stl" />
</geometry>
</collision>
</link>
<joint name="panda_joint1" type="revolute">
<safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-2.8973" soft_upper_limit="2.8973" />
<origin rpy="0 0 0" xyz="0 0 0.333" />
<parent link="panda_link0" />
<child link="panda_link1" />
<axis xyz="0 0 1" />
<limit effort="87" lower="-2.9671" upper="2.9671" velocity="2.3925" />
</joint>
<link name="panda_link2">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/link2.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/link2.stl" />
</geometry>
</collision>
</link>
<joint name="panda_joint2" type="revolute">
<safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-1.7628" soft_upper_limit="1.7628" />
<origin rpy="-1.57079632679 0 0" xyz="0 0 0" />
<parent link="panda_link1" />
<child link="panda_link2" />
<axis xyz="0 0 1" />
<limit effort="87" lower="-1.8326" upper="1.8326" velocity="2.3925" />
</joint>
<link name="panda_link3">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/link3.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/link3.stl" />
</geometry>
</collision>
</link>
<joint name="panda_joint3" type="revolute">
<safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-2.8973" soft_upper_limit="2.8973" />
<origin rpy="1.57079632679 0 0" xyz="0 -0.316 0" />
<parent link="panda_link2" />
<child link="panda_link3" />
<axis xyz="0 0 1" />
<limit effort="87" lower="-2.9671" upper="2.9671" velocity="2.3925" />
</joint>
<link name="panda_link4">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/link4.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/link4.stl" />
</geometry>
</collision>
</link>
<joint name="panda_joint4" type="revolute">
<safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-3.0718" soft_upper_limit="0.0175" />
<origin rpy="1.57079632679 0 0" xyz="0.0825 0 0" />
<parent link="panda_link3" />
<child link="panda_link4" />
<axis xyz="0 0 1" />
<limit effort="87" lower="-3.1416" upper="0.0873" velocity="2.3925" />
</joint>
<link name="panda_link5">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/link5.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/link5.stl" />
</geometry>
</collision>
</link>
<joint name="panda_joint5" type="revolute">
<safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-2.8973" soft_upper_limit="2.8973" />
<origin rpy="-1.57079632679 0 0" xyz="-0.0825 0.384 0" />
<parent link="panda_link4" />
<child link="panda_link5" />
<axis xyz="0 0 1" />
<limit effort="12" lower="-2.9671" upper="2.9671" velocity="2.8710" />
</joint>
<link name="panda_link6">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/link6.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/link6.stl" />
</geometry>
</collision>
</link>
<joint name="panda_joint6" type="revolute">
<safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-0.0175" soft_upper_limit="3.7525" />
<origin rpy="1.57079632679 0 0" xyz="0 0 0" />
<parent link="panda_link5" />
<child link="panda_link6" />
<axis xyz="0 0 1" />
<limit effort="12" lower="-0.0873" upper="3.8223" velocity="2.8710" />
</joint>
<link name="panda_link7">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/link7.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/link7.stl" />
</geometry>
</collision>
</link>
<joint name="panda_joint7" type="revolute">
<safety_controller k_position="100.0" k_velocity="40.0" soft_lower_limit="-2.8973" soft_upper_limit="2.8973" />
<origin rpy="1.57079632679 0 0" xyz="0.088 0 0" />
<parent link="panda_link6" />
<child link="panda_link7" />
<axis xyz="0 0 1" />
<limit effort="12" lower="-2.9671" upper="2.9671" velocity="2.8710" />
</joint>
<link name="panda_link8" />
<joint name="panda_joint8" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0.107" />
<parent link="panda_link7" />
<child link="panda_link8" />
<axis xyz="0 0 0" />
</joint>
<joint name="panda_hand_joint" type="fixed">
<parent link="panda_link8" />
<child link="panda_hand" />
<origin rpy="0 0 -0.785398163397" xyz="0 0 0" />
</joint>
<link name="panda_hand">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/hand.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/hand.stl" />
</geometry>
</collision>
</link>
<link name="panda_leftfinger">
<visual>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/finger.dae" />
</geometry>
</visual>
<collision>
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/finger.stl" />
</geometry>
</collision>
</link>
<link name="panda_rightfinger">
<visual>
<origin rpy="0 0 3.14159265359" xyz="0 0 0" />
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/visual/finger.dae" />
</geometry>
</visual>
<collision>
<origin rpy="0 0 3.14159265359" xyz="0 0 0" />
<geometry>
<mesh filename="package://moveit_resources_panda_description/meshes/collision/finger.stl" />
</geometry>
</collision>
</link>
<joint name="panda_finger_joint1" type="prismatic">
<parent link="panda_hand" />
<child link="panda_leftfinger" />
<origin rpy="0 0 0" xyz="0 0 0.0584" />
<axis xyz="0 1 0" />
<limit effort="20" lower="0.0" upper="0.04" velocity="0.2" />
</joint>
<joint name="panda_finger_joint2" type="prismatic">
<parent link="panda_hand" />
<child link="panda_rightfinger" />
<origin rpy="0 0 0" xyz="0 0 0.0584" />
<axis xyz="0 -1 0" />
<limit effort="20" lower="0.0" upper="0.04" velocity="0.2" />
<mimic joint="panda_finger_joint1" />
</joint>
</robot>
官方urdf说明文档
SRDF文件例子
panda.srdf
文件,用来描述panda机械手的关节组,各种状态下各个轴的角度值,各个轴之间是否需要做干涉判断的参数。
<?xml version="1.0" encoding="utf-8"?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from panda_arm_hand.srdf.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<!--This does not replace URDF, and is not an extension of URDF.
This is a format for representing semantic information about the robot structure.
A URDF file must exist for this robot as well, where the joints and the links that are referenced are defined
-->
<robot name="panda">
<!--GROUPS: Representation of a set of joints and links. This can be useful for specifying DOF to plan for, defining arms, end effectors, etc-->
<!--LINKS: When a link is specified, the parent joint of that link (if it exists) is automatically included-->
<!--JOINTS: When a joint is specified, the child link of that joint (which will always exist) is automatically included-->
<!--CHAINS: When a chain is specified, all the links along the chain (including endpoints) are included in the group. Additionally, all the joints that are parents to included links are also included. This means that joints along the chain and the parent joint of the base link are included in the group-->
<!--SUBGROUPS: Groups can also be formed by referencing to already defined group names-->
<group name="panda_arm">
<chain base_link="panda_link0" tip_link="panda_link8"/>
</group>
<!--GROUP STATES: Purpose: Define a named state for a particular group, in terms of joint values. This is useful to define states like 'folded arms'-->
<group_state group="panda_arm" name="ready">
<joint name="panda_joint1" value="0"/>
<joint name="panda_joint2" value="-0.785"/>
<joint name="panda_joint3" value="0"/>
<joint name="panda_joint4" value="-2.356"/>
<joint name="panda_joint5" value="0"/>
<joint name="panda_joint6" value="1.571"/>
<joint name="panda_joint7" value="0.785"/>
</group_state>
<group_state group="panda_arm" name="extended">
<joint name="panda_joint1" value="0"/>
<joint name="panda_joint2" value="0"/>
<joint name="panda_joint3" value="0"/>
<joint name="panda_joint4" value="0"/>
<joint name="panda_joint5" value="0"/>
<joint name="panda_joint6" value="1.571"/>
<joint name="panda_joint7" value="0.785"/>
</group_state>
<group_state group="panda_arm" name="transport">
<joint name="panda_joint1" value="0"/>
<joint name="panda_joint2" value="-0.5599"/>
<joint name="panda_joint3" value="0"/>
<joint name="panda_joint4" value="-2.97"/>
<joint name="panda_joint5" value="0"/>
<joint name="panda_joint6" value="0"/>
<joint name="panda_joint7" value="0.785"/>
</group_state>
<!--END EFFECTOR: Purpose: Represent information about an end effector.-->
<!--VIRTUAL JOINT: Purpose: this element defines a virtual joint between a robot link and an external frame of reference (considered fixed with respect to the robot)-->
<virtual_joint child_link="panda_link0" name="virtual_joint" parent_frame="world" type="floating"/>
<!--DISABLE COLLISIONS: By default it is assumed that any link of the robot could potentially come into collision with any other link in the robot. This tag disables collision checking between a specified pair of links. -->
<disable_collisions link1="panda_link0" link2="panda_link1" reason="Adjacent"/>
<disable_collisions link1="panda_link0" link2="panda_link2" reason="Never"/>
<disable_collisions link1="panda_link0" link2="panda_link3" reason="Never"/>
<disable_collisions link1="panda_link0" link2="panda_link4" reason="Never"/>
<disable_collisions link1="panda_link1" link2="panda_link2" reason="Adjacent"/>
<disable_collisions link1="panda_link1" link2="panda_link3" reason="Never"/>
<disable_collisions link1="panda_link1" link2="panda_link4" reason="Never"/>
<disable_collisions link1="panda_link2" link2="panda_link3" reason="Adjacent"/>
<disable_collisions link1="panda_link2" link2="panda_link4" reason="Never"/>
<disable_collisions link1="panda_link2" link2="panda_link6" reason="Never"/>
<disable_collisions link1="panda_link3" link2="panda_link4" reason="Adjacent"/>
<disable_collisions link1="panda_link3" link2="panda_link5" reason="Never"/>
<disable_collisions link1="panda_link3" link2="panda_link6" reason="Never"/>
<disable_collisions link1="panda_link3" link2="panda_link7" reason="Never"/>
<disable_collisions link1="panda_link4" link2="panda_link5" reason="Adjacent"/>
<disable_collisions link1="panda_link4" link2="panda_link6" reason="Never"/>
<disable_collisions link1="panda_link4" link2="panda_link7" reason="Never"/>
<disable_collisions link1="panda_link5" link2="panda_link6" reason="Adjacent"/>
<disable_collisions link1="panda_link6" link2="panda_link7" reason="Adjacent"/>
<!--GROUPS: Representation of a set of joints and links. This can be useful for specifying DOF to plan for, defining arms, end effectors, etc-->
<!--LINKS: When a link is specified, the parent joint of that link (if it exists) is automatically included-->
<!--JOINTS: When a joint is specified, the child link of that joint (which will always exist) is automatically included-->
<!--CHAINS: When a chain is specified, all the links along the chain (including endpoints) are included in the group. Additionally, all the joints that are parents to included links are also included. This means that joints along the chain and the parent joint of the base link are included in the group-->
<!--SUBGROUPS: Groups can also be formed by referencing to already defined group names-->
<group name="hand">
<link name="panda_hand"/>
<link name="panda_leftfinger"/>
<link name="panda_rightfinger"/>
<joint name="panda_finger_joint1"/>
<passive_joint name="panda_finger_joint2"/>
</group>
<!--GROUP STATES: Purpose: Define a named state for a particular group, in terms of joint values. This is useful to define states like 'folded arms'-->
<!--END EFFECTOR: Purpose: Represent information about an end effector.-->
<!--DISABLE COLLISIONS: By default it is assumed that any link of the robot could potentially come into collision with any other link in the robot. This tag disables collision checking between a specified pair of links. -->
<disable_collisions link1="panda_hand" link2="panda_leftfinger" reason="Adjacent"/>
<disable_collisions link1="panda_hand" link2="panda_rightfinger" reason="Adjacent"/>
<disable_collisions link1="panda_leftfinger" link2="panda_rightfinger" reason="Default"/>
<!--GROUPS: Representation of a set of joints and links. This can be useful for specifying DOF to plan for, defining arms, end effectors, etc-->
<!--LINKS: When a link is specified, the parent joint of that link (if it exists) is automatically included-->
<!--JOINTS: When a joint is specified, the child link of that joint (which will always exist) is automatically included-->
<!--CHAINS: When a chain is specified, all the links along the chain (including endpoints) are included in the group. Additionally, all the joints that are parents to included links are also included. This means that joints along the chain and the parent joint of the base link are included in the group-->
<!--SUBGROUPS: Groups can also be formed by referencing to already defined group names-->
<group name="panda_arm_hand">
<group name="panda_arm"/>
<group name="hand"/>
</group>
<group_state group="hand" name="open">
<joint name="panda_finger_joint1" value="0.035"/>
<joint name="panda_finger_joint2" value="0.035"/>
</group_state>
<group_state group="hand" name="close">
<joint name="panda_finger_joint1" value="0"/>
<joint name="panda_finger_joint2" value="0"/>
</group_state>
<!--END EFFECTOR: Purpose: Represent information about an end effector.-->
<end_effector group="hand" name="hand" parent_group="panda_arm" parent_link="panda_link8"/>
<!--DISABLE COLLISIONS: By default it is assumed that any link of the robot could potentially come into collision with any other link in the robot. This tag disables collision checking between a specified pair of links. -->
<disable_collisions link1="panda_hand" link2="panda_link3" reason="Never"/>
<disable_collisions link1="panda_hand" link2="panda_link4" reason="Never"/>
<disable_collisions link1="panda_hand" link2="panda_link6" reason="Never"/>
<disable_collisions link1="panda_hand" link2="panda_link7" reason="Adjacent"/>
<disable_collisions link1="panda_leftfinger" link2="panda_link3" reason="Never"/>
<disable_collisions link1="panda_leftfinger" link2="panda_link4" reason="Never"/>
<disable_collisions link1="panda_leftfinger" link2="panda_link6" reason="Never"/>
<disable_collisions link1="panda_leftfinger" link2="panda_link7" reason="Never"/>
<disable_collisions link1="panda_link3" link2="panda_rightfinger" reason="Never"/>
<disable_collisions link1="panda_link4" link2="panda_rightfinger" reason="Never"/>
<disable_collisions link1="panda_link6" link2="panda_rightfinger" reason="Never"/>
<disable_collisions link1="panda_link7" link2="panda_rightfinger" reason="Never"/>
</robot>
总结
以上就是本篇博文要分享的内容,分析了URDF和SRDF文件内包含的配置参数及作用,后续会在此基础上拓展如何建立一个URDF文件并验证运动学传递是否正确。