Gazebo | Ignition | Community
Ask Your Question
0

[ignition][Fortress] Problem in finding meshes and mesh names of primitive geometry [closed]

asked 2022-07-28 10:20:06 -0500

JK gravatar image

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; }
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by JK
close date 2022-08-02 12:50:26.980494

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-08-02 12:49:17 -0500

JK gravatar image

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

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-07-28 10:20:06 -0500

Seen: 11 times

Last updated: Aug 02