Skip to content

Conversation

renezurbruegg
Copy link
Collaborator

Description

This PR streamlines the workflow for using the debug draw interface in IsaacLab.

Problem

At the moment, debug_draw is not convenient to use:

  • Each component must access the raw draw_interface directly.
  • Users need to manually clear previous drawings when visualizing different elements across simulation steps.
  • This makes it difficult (and error-prone) when multiple components attempt to draw simultaneously, as each component either removes the previous drawing or the drawings accumulute over all the simulation steps.

Solution

Introduce a singleton DrawInterface, exposed through the SimulationContext.
This interface automatically manages clearing, caching, and rendering, enabling simple and consistent debug visualizations without interfering across components.

Example Usage

def _debug_vis_callback(self, event):
    draw_interface = SimulationContext.instance().draw_interface
    pts_x, pts_y, colors = ...  # compute line data
    draw_interface.plot_lines(pts_x, pts_y, colors)

You can run a demo (visualizing raycast sensor rays) with:

python scripts/demos/debug_draw.py
raycast-visualization

Additional Examples

The new interface also allows to:

  • Visualizing point cloud data from multiple sensors
  • Displaying seven-segment numbers
pointcloud-and-numbers

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions bot added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request isaac-lab Related to Isaac Lab team labels Sep 11, 2025
@Mayankm96 Mayankm96 removed bug Something isn't working documentation Improvements or additions to documentation labels Sep 11, 2025
@renezurbruegg renezurbruegg changed the title Feature/debug draw interface Adds Debug Draw Interface Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request isaac-lab Related to Isaac Lab team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants