Skip to content

[Bug Report] Raycaster calling visualization with empty inputs #4518

@DreaverZhao

Description

@DreaverZhao

Describe the bug

If all rays of the raycaster sensors hit nothing within the max_distance, and we enable the debug visualization of them, we'll get ValueErrors printed in the terminal. It won't affect normal training though.

Steps to reproduce

Set up a raycaster (or its variants) with a given max_distance. For instance, I use the following setup (what really matters here is setting a max_distance and setting ray_alignment to 'base', other cfgs are not important).

height_sensor: MultiMeshRayCasterCfg = MultiMeshRayCasterCfg(
      prim_path="/World/envs/env_.*/Robot/body",
      update_period=0.02,
      offset=MultiMeshRayCasterCfg.OffsetCfg(pos=(0.05, 0.0, 0.0)),
      pattern_cfg=patterns.GridPatternCfg(resolution=0.02, size=[0.0, 0.0]),
      max_distance=4.0,
      debug_vis=True,
      ray_alignment='base',
      mesh_prim_paths=["/World/ground"]
)

Spawn an agent upside down, so that the sensor points towards the sky and the ray hits nothing. Then we'll see printed errors in the terminal similar to:

Traceback (most recent call last):
  File "/home/dreaver/IsaacLab/source/isaaclab/isaaclab/sensors/sensor_base.py", line 159, in <lambda>
    lambda event, obj=weakref.proxy(self): obj._debug_vis_callback(event)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dreaver/IsaacLab/source/isaaclab/isaaclab/sensors/ray_caster/ray_caster.py", line 329, in _debug_vis_callback
    self.ray_visualizer.visualize(viz_points)
  File "/home/dreaver/IsaacLab/source/isaaclab/isaaclab/markers/visualization_markers.py", line 330, in visualize
    raise ValueError("Number of markers cannot be zero! Hint: The function was called with no inputs?")
ValueError: Number of markers cannot be zero! Hint: The function was called with no inputs?

It won't affect the training or testing process. Yet it's a little bit annoying.

System Info

  • Commit: [764aeb4]
  • Isaac Sim Version: [5.1.0]
  • OS: [Ubuntu 22.04]
  • GPU: [RTX 4060Ti 16G]
  • CUDA: [12.9]
  • GPU Driver: [580.126.09]

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions