Skip to content

Commit 7253d64

Browse files
URDF documentation Update (Unity-Technologies#222)
* Adding primitive sizing documentation * Add list of supported URDF tags
1 parent 664f029 commit 7253d64

File tree

3 files changed

+83
-1
lines changed

3 files changed

+83
-1
lines changed
17.4 KB
Loading
24.7 KB
Loading

tutorials/urdf_importer/urdf_appendix.md

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
# URDF Tutorials Appendix
2+
- [File Hierarchy](##File-Hierarchy)
3+
- [GameObject Hierarchy](##GameObject-Hierarchy)
4+
- [URDF Comparator](##URDF-Comparator)
5+
- [Articulation Body axis definition](##Articulation-Body-axis-definition)
6+
- [Guide to write your own controller](##Guide-to-write-your-own-controller)
7+
- [Using FK Robot Script](##Using-FK-Robot-Script)
8+
- [Convex Mesh Collider](##Convex-Mesh-Collider)
9+
- [Supported Tags in URDF](##Supported-Tags-in-URDF)
10+
- [Disable Collision Support](##Disable-Collision-Support)
11+
- [Sizing of Primitives](##Sizing-of-Primitives)
12+
213

314
## File Hierarchy
415
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.
@@ -316,8 +327,59 @@ To address this predicament we have integrated another algorithm to create Conve
316327

317328
![](images/ConvexMeshComparison.png)
318329

330+
## Supported Tags in URDF
331+
332+
- Link
333+
- Name
334+
- Inertial
335+
- origin
336+
- xyz
337+
- rpy
338+
- mass
339+
- inertia
340+
- visual
341+
- name
342+
- origin
343+
- xyz
344+
- rpy
345+
- geometry
346+
- box
347+
- cylinder
348+
- sphere
349+
- mesh
350+
- material
351+
- color
352+
- texture
353+
- collision
354+
- name
355+
- origin
356+
- xyz
357+
- rpy
358+
- geometry
359+
- joint
360+
- name
361+
- type
362+
- origin
363+
- xyz
364+
- rpy
365+
- parent
366+
- link
367+
- child
368+
- link
369+
- axis
370+
- xyz
371+
- dynamics
372+
- damping
373+
- friction
374+
- limit
375+
- lower
376+
- upper
377+
378+
379+
380+
319381
## Disable Collision Support
320-
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:
382+
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:
321383

322384
1. Identify the links between which you want to ignore the collisions.
323385
2. Add a tag in the URDF file with the format
@@ -331,3 +393,23 @@ The disable collision tag flags the links that need to be ignored to the URDF pa
331393

332394
Note: You can also manually ignore collisions in Unity using [APIs](https://docs.unity3d.com/ScriptReference/Physics.IgnoreCollision.html).
333395

396+
## Sizing of Primitives
397+
398+
```xml
399+
<collision>
400+
<geometry>
401+
<cylinder size=".4 .3 .4" />
402+
</geometry>
403+
</collision>
404+
```
405+
406+
The URDF Importer will set the size of the primitive using the "scale" parameter of the GameObject that contains the UrdfCollsion script.
407+
408+
| ![Collision gameObject in hierarchy](images/link_hierarchy.png) | ![Size of primitive set using scale](images/primitive_scale.png) |
409+
|:---:|:---:|
410+
411+
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.
412+
413+
414+
415+

0 commit comments

Comments
 (0)