浏览代码

URDF documentation Update (#222)

* Adding primitive sizing documentation
* Add list of supported URDF tags
/merge-resolve-conflicts
peifeng-unity 3 年前
当前提交
e09155f6
共有 3 个文件被更改,包括 263 次插入1 次删除
  1. 84
      tutorials/urdf_importer/urdf_appendix.md
  2. 64
      tutorials/urdf_importer/images/link_hierarchy.png
  3. 116
      tutorials/urdf_importer/images/primitive_scale.png

84
tutorials/urdf_importer/urdf_appendix.md


# URDF Tutorials Appendix
- [File Hierarchy](##File-Hierarchy)
- [GameObject Hierarchy](##GameObject-Hierarchy)
- [URDF Comparator](##URDF-Comparator)
- [Articulation Body axis definition](##Articulation-Body-axis-definition)
- [Guide to write your own controller](##Guide-to-write-your-own-controller)
- [Using FK Robot Script](##Using-FK-Robot-Script)
- [Convex Mesh Collider](##Convex-Mesh-Collider)
- [Supported Tags in URDF](##Supported-Tags-in-URDF)
- [Disable Collision Support](##Disable-Collision-Support)
- [Sizing of Primitives](##Sizing-of-Primitives)
## File Hierarchy
URDF files and associated meshes should be placed in a single folder within the Assets directory of Unity. We suggest creating a new folder with the robot's name and place the URDF file in its root with all associated mesh files in sub folders. Be sure to update the file locations as described by the URDF file.

![](images/ConvexMeshComparison.png)
## Supported Tags in URDF
- Link
- Name
- Inertial
- origin
- xyz
- rpy
- mass
- inertia
- visual
- name
- origin
- xyz
- rpy
- geometry
- box
- cylinder
- sphere
- mesh
- material
- color
- texture
- collision
- name
- origin
- xyz
- rpy
- geometry
- joint
- name
- type
- origin
- xyz
- rpy
- parent
- link
- child
- link
- axis
- xyz
- dynamics
- damping
- friction
- limit
- lower
- upper
URDF defines the robot visually using Visual Meshes, and its collision using Collision Meshes. Collision meshes define the physical volume of the links, and are used to calculate the inertia of the links and also to detect collisions between different physical objects. In Unity, rigidbodies cannot have concave collision meshes, so when importing a concave collision mesh, all concave regions are closed over to produce a convex outline. As a result, the convex shapes might intersect with each other, creating a hindrance in robot movement. To remedy this, we support a ```disable collision``` tag in URDF. To add an exception for collision detection in Unity:
URDF defines the robot visually using Visual Meshes, and its collision using Collision Meshes. Collision meshes define the physical volume of the links, and are used to calculate the inertia of the links and also to detect collisions between different physical objects. In Unity, [RigidBodies](https://docs.unity3d.com/ScriptReference/Rigidbody.html) cannot have concave collision meshes, so when importing a concave collision mesh, all concave regions are closed over to produce a convex outline. As a result, the convex shapes might intersect with each other, creating a hindrance in robot movement. To remedy this, we support a ```disable collision``` tag in URDF. To add an exception for collision detection in Unity:
1. Identify the links between which you want to ignore the collisions.
2. Add a tag in the URDF file with the format

Note: You can also manually ignore collisions in Unity using [APIs](https://docs.unity3d.com/ScriptReference/Physics.IgnoreCollision.html).
## Sizing of Primitives
```xml
<collision>
<geometry>
<cylinder size=".4 .3 .4" />
</geometry>
</collision>
```
The URDF Importer will set the size of the primitive using the "scale" parameter of the GameObject that contains the UrdfCollsion script.
| ![Collision gameObject in hierarchy](images/link_hierarchy.png) | ![Size of primitive set using scale](images/primitive_scale.png) |
|:---:|:---:|
The reason we set the size via the "scale" of the parent GameObject as opposed to the "size" of the primitive collider is to have consistency across different mesh types; the size API is only available for primitive mesh colliders and not for complex collider meshes and visual meshes, whose size must be changed using their parent GameObject's "scale" parameter. The "scale" parameter of the gameObject is also used to set the values of primitive "size" in the URDF when performing a URDF export.

64
tutorials/urdf_importer/images/link_hierarchy.png

之前 之后
宽度: 660  |  高度: 130  |  大小: 17 KiB

116
tutorials/urdf_importer/images/primitive_scale.png

之前 之后
宽度: 844  |  高度: 186  |  大小: 25 KiB
正在加载...
取消
保存