0
$\begingroup$

I am trying to use a tunnel-like mesh in gazebo as a model of its own. I have the pointcloud and I followed this tutorial to transform it to a mesh https://gazebosim.org/api/gazebo/3.3/pointcloud.html

My problem is that on gazebo, the inside of the mesh is completely transparent so the inside of the tunnel cannot be detected by a lidar. Any idea how to fix it ?

$\endgroup$

2 Answers 2

1
$\begingroup$

Sounds like you're seeing backface culling, where faces that don't point toward the viewer aren't rendered. Here's what it looks like when face normals aren't rendered correctly (from this page):

teapot normals

There are typically a couple ways around this:

  1. Invert the normals in CloudCompare, but this will mean the outside of the mesh is transparent and the inside is visible.
  2. Duplicate the mesh and flip the normals to get a "two-faced" mesh. With Blender, open the mesh, select the mesh, hit "tab" to go to edit mode, hit "a" to select all, "shift + D" to duplicate the mesh, "esc" to cancel moving it, then go to Mesh -> Normals -> Flip and flip the normals.
  3. It might be possible to disable backface culling in gazebo but the link in that post is dead, and I don't get any results when I search for backface culling.

That's it, typically - either the normals exist (options 1 and 2) or you tell the engine to ignore the normals (option 3). The lidar itself will generally render only what the engine allows to be rendered, and if the normals are getting culled then there's nothing there for the lidar to detect.

I have not used Gazebo, though, so things might be different there.

$\endgroup$
1
  • 1
    $\begingroup$ Tried option 2 and it worked perfectly. thank you! $\endgroup$
    – mh1309
    Dec 12, 2022 at 16:18
2
$\begingroup$

The issue is likely that your normals are flipped the wrong way. Polygons only face one direction and for a tunnel they need to be facing inward. Fortunately flipping normals is a pretty quick operation. Load the mesh in blender then select all the faces and got to Mesh > Normals > Flip. This should flip all normals so they are facing inward.

$\endgroup$
1
  • $\begingroup$ Yes but i needed both sides so I tried Chuck's solution of putting two meshes together, one flipped and one not. Thanks. $\endgroup$
    – mh1309
    Dec 12, 2022 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.