You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug Report] Incorrect 2D-LiDAR hit points with RayCaster #3013
I tried to implement a very basic 2D LiDAR to detect obstacles around the robot—something that should be quite straightforward—but I haven’t been able to get it working correctly. After a few days of research and discussions with others, I’m starting to suspect that this might be a bug.
Describe the bug
The LiDAR does work, and I can see the hit points rendered. However, some of the points are clearly incorrect and appear far from where they should be. Here’s a screenshot:
At first, I thought it might just be a rendering issue. But after collecting the data and plotting it manually with Matplotlib, the results matched exactly what I see on screen—confirming that the issue likely lies within the RayCaster itself:
Steps to reproduce
I implemented it as a RayCaster directly in the config file of my RL environment, like this:
changed the title [-][Bug Report] Incorrect LiDAR hit points with RayCaster[/-][+][Bug Report] Incorrect 2D-LiDAR hit points with RayCaster[/+]on Jul 24, 2025
had a similar problem, I suspected the mesh was not shaped correctly, then converted it to an SDF mesh. But the raycaster still gave some weird points and it didn't match the physics colliders in the GUI, very annoying.
Just to add some details. It looks like the lidar sometimes doesn't hit the outer mesh but one of the inner triangles; it feels like some faces are missing, so basically the lidar is going through the object and hitting the mesh in the back. Here a screenshot:
In my case, some point hit the external surface of the mesh, meanwhile, a lot of points hit the inside surface of the mesh. I am doing a project related to SLAM, it is very confusing.
thanks for looking into this. How did you add the boxes to the scene? It would be great to have the entire environment config. When using typical trimesh objects (box, cylinder, ...) everything works fine.
First thought is that the normals are wrongly oriented, which can mess up collisions, raycasting, ... (even just try to drive with your robot into the wall that the LiDAR penetrates).
Thanks @d-corsi, @Fuhua-Bot, and @sghatak5 — I reproduced a current RayCaster mesh-import bug that matches these interior hits. BaseRayCaster._initialize_warp_meshes() currently forwards USD faceVertexIndices directly to Warp without applying faceVertexCounts; for quad/ngon meshes this creates artificial triangles. In a six-quad cube test, a ray that should hit the outer face at 2 m instead hit an artificial interior triangle at 3 m. Keeping this open; the fix is to triangulate USD polygon faces before building the Warp mesh and add a regression test.
@maxkra15 I have the fix you describe here on a branch: BaseRayCaster._initialize_warp_meshes() passes the USD faces through convert_faces_to_triangles() with faceVertexCounts, the helper MultiMeshRayCaster already uses, plus a unit test that builds a closed box from six quads on an in-memory stage and casts four rays at one face. On current develop two of the four rays go through that face and report a distance of 4.0 instead of 2.0; with the change all four report 2.0. Since the issue is assigned to you, would you like me to open it as a pull request, or do you already have this in progress?
Activity
[-][Bug Report] Incorrect LiDAR hit points with RayCaster[/-][+][Bug Report] Incorrect 2D-LiDAR hit points with RayCaster[/+]Fuhua-Bot commentedon Jul 25, 2025
had a similar problem, I suspected the mesh was not shaped correctly, then converted it to an SDF mesh. But the raycaster still gave some weird points and it didn't match the physics colliders in the GUI, very annoying.
RandomOakForest commentedon Jul 26, 2025
Thank you for posting this with such detail, and for trying both versions of Isaac Sim. The team will review this.
d-corsi commentedon Jul 27, 2025
Just to add some details. It looks like the lidar sometimes doesn't hit the outer mesh but one of the inner triangles; it feels like some faces are missing, so basically the lidar is going through the object and hitting the mesh in the back. Here a screenshot:
Fuhua-Bot commentedon Jul 28, 2025
Yes, my case is almost the same, so I converted some meshes into SDF mesh with 1024 parameter, it helps a bit, but not compeletly solve this issue.
Fuhua-Bot commentedon Jul 28, 2025
In my case, some point hit the external surface of the mesh, meanwhile, a lot of points hit the inside surface of the mesh. I am doing a project related to SLAM, it is very confusing.
outside surface:

inside the mech:

my sdf mesh:
pascal-roth commentedon Aug 5, 2025
Hi @d-corsi,
thanks for looking into this. How did you add the boxes to the scene? It would be great to have the entire environment config. When using typical trimesh objects (box, cylinder, ...) everything works fine.
First thought is that the normals are wrongly oriented, which can mess up collisions, raycasting, ... (even just try to drive with your robot into the wall that the LiDAR penetrates).
sghatak5 commentedon Aug 5, 2025
Hi @pascal-roth ,
I had similar issues, I can share my configuration if that helps.
Created 4 cubes meshes with collider preset as physics and grouped them.
Using the meshmergetool, merged the 4 cube mesh into 1 mesh and exported as a USD. Spawned the usd inside a scene.
Raycaster config:
WAFFLE_RAYCASTERCFG = RayCasterCfg(
update_period=1/5.5,
offset=RayCasterCfg.OffsetCfg(pos=(0, 0, 0.121)),
ray_alignment="base",
pattern_cfg=patterns.LidarPatternCfg(
channels=1, vertical_fov_range=[0, 0], horizontal_fov_range=[-90, 90], horizontal_res=0.2
),
debug_vis=True,
)
Main file:
Output:
With a 180 degree horizontal fov, it does not cast ray on all the surface.
Additionally, when I plot the hit_points in matplotlib, i get this.
maxkra15 commentedon Sep 22, 2026
Thanks @d-corsi, @Fuhua-Bot, and @sghatak5 — I reproduced a current RayCaster mesh-import bug that matches these interior hits.
BaseRayCaster._initialize_warp_meshes()currently forwards USDfaceVertexIndicesdirectly to Warp without applyingfaceVertexCounts; for quad/ngon meshes this creates artificial triangles. In a six-quad cube test, a ray that should hit the outer face at 2 m instead hit an artificial interior triangle at 3 m. Keeping this open; the fix is to triangulate USD polygon faces before building the Warp mesh and add a regression test.Arthur031221 commentedon Sep 29, 2026
@maxkra15 I have the fix you describe here on a branch:
BaseRayCaster._initialize_warp_meshes()passes the USD faces throughconvert_faces_to_triangles()withfaceVertexCounts, the helperMultiMeshRayCasteralready uses, plus a unit test that builds a closed box from six quads on an in-memory stage and casts four rays at one face. On currentdeveloptwo of the four rays go through that face and report a distance of 4.0 instead of 2.0; with the change all four report 2.0. Since the issue is assigned to you, would you like me to open it as a pull request, or do you already have this in progress?Fix ray mesh triangulation and query shape validation (isaac-sim#8781)