浏览代码

Adding primitive sizing documentation

/vidur-adding-primitive-size-documentation
vidurvij-Unity 3 年前
当前提交
d66b68ab
共有 3 个文件被更改,包括 200 次插入1 次删除
  1. 21
      tutorials/urdf_importer/urdf_appendix.md
  2. 64
      tutorials/urdf_importer/images/link_hierarchy.png
  3. 116
      tutorials/urdf_importer/images/primitive_scale.png

21
tutorials/urdf_importer/urdf_appendix.md


![](images/ConvexMeshComparison.png)
## 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 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>
<collision>
```
The size of the primitive will be set in Unity by changing the scale of gameObject containing UrdfCollision script.
| ![Collision gameObject in hierarchy](images/link_hierarchy.png) | ![Size of primitive set using scale](images/primitive_scale.png) |
|:---:|:---:|
This is done, as opposed to using the size API of the primitive collider, to have consistency across different mesh types. The sizing API is only available for primitive mesh colliders and not for complex collider meshes and visual meshes. Thats why we use the parent's scaling to change the shape of the primitive mesh. This scale is exported as the primitive size during 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
正在加载...
取消
保存