[ignition][Fortress] Problem in finding meshes and mesh names of primitive geometry
I am currently writing a system plugin for integrating an efficient lidar simulator. I am getting meshes using sdf_mesh->URI and searching for that mesh name using the MeshManager class.
The problem is that primitive geometry (such as box, sphere, etc.) doesn't have a way to access the URI, since they don't have one, so I am left wondering how can I find out, what their mesh names are, so I can get the meshes using the MeshManager.
bool GetMesh(const ignition::gazebo::components::Geometry* geometry,
int& v_count, int& i_count, rgl_vec3f*& vertices, rgl_vec3i** indices) {
auto mesh_sdf = geometry->Data().MeshShape();
if (mesh_sdf == nullptr) return false;
auto mesh_common = mesh_manager->MeshByName(mesh_sdf->Uri());
if (mesh_common == nullptr) return false; }
Asked by JK on 2022-07-28 10:20:06 UTC
Answers
For someone who might also be interested in the answer:
the most primitive types are created by the MeshManager itself, You can search the source file or just use these: "unit_box" , "unit_cylinder" , "unit_plane" , "unit_sphere" and scale them accordingly to obtain more complex shapes
Asked by JK on 2022-08-02 12:49:17 UTC
Comments