-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible to supply custom MeshLoader #404
Comments
|
Thanks. I think there are still cases where custom loader would be helpful:
|
Hi @mahiuchun, I am currently working on the assimp mesh loader, and would love to implement the functionalities you are referring.
|
I wanted to add some context on some of the questions posed by onurtore@ For some situation we have geometry loaded in memory inside a gazebo plugin. This plugin then modifies the world by inserting a model with some new geometry. It would be ideal for the plugin to hand over the geometry data directly to gazebo instead of having to write the geometry to disk, and then reference the new files in the inserted model. As for the other questions, I think there are many flags/options that you specify to the assimp importer like deduplicate vertex and drop points. These are are currently set in the constructor for the AssimpoLoader class: gz-common/graphics/src/AssimpLoader.cc Line 610 in 466f83f
Anyway I think the main benefit for me specifically is the handover for in memory data. |
Regarding handing over in-memory data to gazebo, if vertices, normals, texcords, etc info are available, the user can hand them over by creating a gz::common::Mesh object and registering the mesh with the However, gz-sim still expects meshes to be specified as an URI in SDF. The code that loads meshes in gz sim is: We'll still need to modify these two places to support loading meshes by name (e.g. name of the |
Desired behavior
A developer using Gazebo could choose to supply a custom MeshLoader.
The choice of MeshLoader could be determined by file extensions. More elaborate choice logic could be considered too.
Alternatives considered
N/A
Implementation suggestion
If we determine MeshLoader by file extensions, replace the current hard-coded logic in MeshManager with a choice logic backed by a hash map.
Additional context
Using the current snapshot of https://github.com/gazebosim/gz-common/tree/luca/assimp_sandbox as an example.
The following was added to MeshManager
If one could choose to use Assimp for other file types (as determined by extensions), it's more flexible.
The text was updated successfully, but these errors were encountered: