robotflow-initiative / pyrfuniverse

all in one embodied AI simulator
https://docs.robotflow.ai/pyrfuniverse/
Apache License 2.0
55 stars 11 forks source link

loadURDF doesn't load obj files correctly #4

Closed ElectronicElephant closed 1 year ago

ElectronicElephant commented 1 year ago

Environment

It happens in any version of RFU.

Steps to reproduce

  1. Download the zip file 01b24b02-0e4e-11ed-81d4-ec2e98c7e246.zip
  2. Use loadURDF function to load it into RFU
  3. The mesh is broken image

Expected Behaviour

  1. Use URDF-Importer extension to load it directly into unity image

  2. In PyBullet, image

ghzh26252 commented 1 year ago

LoadURDF uses URDF-Importer's runtime module, which uses another repo: UnityMeshImporter. The module defaults to using 16-bit vertex IndexFormat when importing meshes, so an exception will occurs when importing meshes with more than 65536 vertices.

The following code has been added to fix this issue: uMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32; This fix will be included in the next release.