Repository navigation
Conversation
- Skip the host copy and upload unless the overlay is on; a dense scan is expensive every visualizer step - Newton GL and Viser expose a checkbox - Backend `show_lidar_points` opts in at launch
* Rename ``show_lidar_points`` to ``show_lidar_hits`` on Newton GL and Viser * Update the HUD checkboxes to Lidar Hits * Drop the Kit launch flag so only Newton GL and Viser expose the overlay
[Medium impact] The PR appears safe to merge, with non-blocking concerns about Kit's extra work and points remaining visible while paused. FindingsSummaryMakes lidar overlays opt-in for Newton GL and Viser.
Reviews (2) · Last reviewed commit: "Drop unused Kit lidar step counter" · Reviewed by Greptile |
| return any(isinstance(sensor, lidar_cls) for sensor in scene.sensors.values()) | ||
|
|
||
|
|
||
| def collect_lidar_hits(sim: SimulationContext, env_ids: list[int] | None) -> list[tuple[str, np.ndarray]]: |
There was a problem hiding this comment.
collect_lidar_hits now accepts two arguments, but KitVisualizer._draw_lidar_points still passes three. Every non-headless Kit step reaches that call, even without a lidar sensor, and raises TypeError before the app update. Preserve the existing Kit call and its ten-step interval, or update Kit alongside this change.
| @lidar_cb.on_update | ||
| def _(event): | ||
| self._show_lidar_hits = event.target.value |
There was a problem hiding this comment.
Turning off Lidar Hits while rendering is paused leaves the last cloud visible. The callback only changes _show_lidar_hits, while step returns before reaching the code that hides the cloud. Newton has the same pause gate around _log_lidar_hits. Apply the hide operation outside the pause gate, without copying a new scan.
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Scope and over-engineering (2), Compatibility and deprecation (3), Implementation (2), Style consistency (4). Other reviewed categories look good.
- PR description: Correct the non-breaking label and pause claim; report validation and baseline/candidate upload latency with revisions, command/workload, hardware, backend, environment count, scan density, runtime environment, and warmup.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: Minimal implementation: extend lidar_points.py, NewtonGLVisualizer._render_frame, ViserVisualizer.step, and existing backend configs; collapse forwarding methods and reuse Viser's viewer-flag checkbox loop; no source modules were added. Keep only toggle state, conditional uploads, and hide transitions. Replace with one smaller PR: these existing implementation/config files, test_lidar_points.py, and the changelog, validated at collector compatibility and backend toggle boundaries. Scope is cohesive; no split recommended.
- API: API changes look good.
- Compatibility and deprecation: Breaking changes: LIDAR_LOG_INTERVAL disappears, collect_lidar_hits loses its third argument and skipped-step result, and unchanged configurations lose automatic overlays; retain old behavior through warnings, migration documentation, removal guidance, and transition coverage.
- Implementation: Both backends skip hide synchronization while rendering is paused, leaving disabled clouds visible; process pending hides outside the pause gates without collecting new hits.
- Style consistency: The edited LiDAR imports violate the required same-package relative-import convention; use relative imports in both visualizers.
- Test quality: Test quality looks good.
Significant concerns. Posted 11 inline findings.
Automated review; human maintainers own approval decisions.
| from isaaclab.visualizers.base_visualizer import BaseVisualizer | ||
|
|
||
|
|
||
| LIDAR_LOG_INTERVAL = 10 |
There was a problem hiding this comment.
🟡 Warning · Compatibility — Retain the interval constant
Removing the documented LIDAR_LOG_INTERVAL breaks existing imports. Retain it for the collector's deprecation transition and document its replacement and removal.
| sim: SimulationContext, env_ids: list[int] | None, step_counter: int | ||
| ) -> list[tuple[str, np.ndarray]] | None: | ||
| """Return every visualized environment's lidar hits on every tenth visualizer step. | ||
| def _ovrtx_lidar_cls() -> type | None: |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Place private helper after public functions
_ovrtx_lidar_cls interrupts the public-function sequence before scene_has_lidar and collect_lidar_hits. Move it after the public functions, as required by the module-order convention.
| return any(isinstance(sensor, lidar_cls) for sensor in scene.sensors.values()) | ||
|
|
||
|
|
||
| def collect_lidar_hits(sim: SimulationContext, env_ids: list[int] | None) -> list[tuple[str, np.ndarray]]: |
There was a problem hiding this comment.
🟡 Warning · Compatibility — Preserve the collector contract
Existing three-argument calls now raise TypeError, and skipped steps no longer return None. Keep the throttled signature through a warned deprecation transition; give the new toggle an unthrottled path and document and test both.
|
|
||
| from isaaclab_visualizers.desktop_entry import write_desktop_entry | ||
| from isaaclab_visualizers.lidar_points import collect_lidar_hits, frame_visualizer_closeup, log_lidar_hits | ||
| from isaaclab_visualizers.lidar_points import frame_visualizer_closeup, scene_has_lidar, sync_lidar_hits |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Use relative package imports
This edited LiDAR import and the corresponding Viser import use absolute paths within the same package. The contribution guide requires relative imports at this depth; change both.
| """Newton GL window with Isaac Lab controls and device-image presentation.""" | ||
|
|
||
| _contacts_available = True | ||
| _lidar_available = False |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Annotate new class variables
_lidar_available and show_lidar_hits are class-level defaults without the required ClassVar[bool] annotations. Add those annotations so their ownership follows the class-member convention.
| if self.cfg.enable_markers: | ||
| render_newton_visualization_markers(viewer, self._env_ids, num_envs=self.backend.model.num_envs) | ||
| self._log_lidar_points(viewer) | ||
| self._log_lidar_hits(viewer) |
There was a problem hiding this comment.
🟡 Warning · Implementation — Clear GL clouds while paused
The HUD can turn hits off while paused, but this call is inside the unpaused branch. The last cloud remains visible until resume; process the pending hide within a frame without collecting hits.
| show_particles: bool = True | ||
| """Show simulation particles. Set to False to hide them, for example in a surface-only view.""" | ||
|
|
||
| show_lidar_hits: bool = False |
There was a problem hiding this comment.
🟡 Warning · Compatibility — Transition the overlay defaults
This and ViserBackendCfg silently hide overlays for unchanged configurations that previously displayed hits every tenth step. Distinguish an omitted flag from explicit False, retain legacy behavior during a warned transition, and document and test migration.
| def _(event, _attr=attr): | ||
| setattr(viewer, _attr, event.target.value) | ||
|
|
||
| lidar_cb = server.gui.add_checkbox("Lidar Hits", initial_value=self._show_lidar_hits) |
There was a problem hiding this comment.
🟡 Warning · Scope Complexity — Reuse Viser's viewer flags
The adjacent _VIZ_FLAGS loop already initializes viewer checkboxes and updates their flags. This separate visualizer state and callback duplicate that path; put show_lidar_hits on the viewer and use the existing loop.
|
|
||
| @lidar_cb.on_update | ||
| def _(event): | ||
| self._show_lidar_hits = event.target.value |
There was a problem hiding this comment.
🟡 Warning · Implementation — Clear Viser clouds while paused
This callback changes the flag, but step returns before LiDAR synchronization when rendering is paused. The old cloud remains visible; clear it on the toggle or process hides outside the pause gate.
|
|
||
| def test_collect_lidar_hits_returns_lidar_clouds_on_the_interval(): | ||
| """Only lidar sensors are returned, and only on every tenth step.""" | ||
| def _lidar_sim(): |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Annotate new test returns
The new _lidar_sim helper and test_sync_lidar_hits_hides_previous_clouds_until_enabled omit return annotations required by the typing guide. Add -> SimpleNamespace and -> None, respectively.
collect_lidar_hits no longer throttles by step, so KitVisualizer does not need to count steps or pass that argument.
| debug-draw interface is reported once and the step continues. | ||
| """ | ||
| hits = collect_lidar_hits(self._sim, self._env_ids, self._step_counter) | ||
| hits = collect_lidar_hits(self._sim, self._env_ids) |
There was a problem hiding this comment.
Kit now copies and redraws lidar hits on every visualizer step instead of every tenth step. Each call copies the selected hits to the CPU and builds a Python tuple for every point. Dense scans therefore repeat this expensive work ten times as often, with no toggle to disable it. Keep Kit's ten-step interval around the updated two-argument call.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Description
Lidar hit overlay in Newton GL and Viser is now opt-in. A dense scan is expensive to copy to the host and upload every visualizer step, so the previous every-tenth-step upload is gone.
The overlay is off by default. Enable it at launch with
NewtonGLBackendCfg.show_lidar_hitsorViserBackendCfg.show_lidar_hits, or at runtime from the Newton HUD / Viser Visualization Markers checkbox. Turning it off hides the last batch.Kit keeps its existing debug-draw path and has no checkbox.
Type of change
Screenshots
Screencast.from.2026-11-25.21-13-23.mp4
Checklist
Docker and GPU tests run on demand. Push the commits you want tested, then
comment
run-cion the pull request, orrun-ci ovstageto include kitless OVStage rendering tests for that run.Subsequent pushes and plain
run-cicomments do not run OVStage tests unless you commentrun-ci ovstageagain.pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there