浏览代码

Update urdf_appendix.md

/vidur-adding-primitive-size-documentation
vidurvij-Unity 3 年前
当前提交
4cc8ff3d
共有 1 个文件被更改,包括 17 次插入7 次删除
  1. 24
      tutorials/urdf_importer/urdf_appendix.md

24
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.

## Disable Collision Support
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

## Sizing of Primitives
```xml
<collision>
<geometry>
<collision>
<geometry>
</geometry>
</collision>
<collision>
</geometry>
</collision>
```
The URDF Importer will set the size of the primitive using the "scale" parameter of the GameObject that contains the UrdfCollsion script.

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 set the values of primitive "size" in the URDF when performing an URDF export.
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.
正在加载...
取消
保存