Skip to content

Conversation

@pascal-roth
Copy link
Collaborator

@pascal-roth pascal-roth commented Jan 29, 2026

Description

Fixes check multi mesh raycaster script and adds additional check script with raycaster attached to H1 robot

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Screenshots

multi_mesh_ray_caster.mp4

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

pascal-roth and others added 2 commits January 28, 2026 16:59
…#4046)

Cleans up new util functions

- Bug fix (non-breaking change which fixes an issue)

- [ ] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) 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

---------

Signed-off-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
Co-authored-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
@github-actions github-actions bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Jan 29, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 29, 2026

Greptile Overview

Greptile Summary

Fixed deprecated PyTorch tensor initialization and migrated codebase from IsaacSim's SimulationContext to IsaacLab's implementation. Added new H1 robot demo with multi-mesh ray caster for testing raycasting with dynamic obstacles.

Key Changes:

  • Fixed torch.Tensor(0) deprecation to torch.zeros(1) in ray caster quaternion calculation
  • Changed default --num_objects from 0 to 20 in check_multi_mesh_ray_caster.py
  • Migrated 20+ test files from isaacsim.core.api.simulation_context.SimulationContext to isaaclab.sim.SimulationContext
  • Replaced verbose SimulationContext initialization with clean SimulationCfg pattern
  • Updated camera view API calls to use instance methods
  • Added new check_multi_mesh_ray_caster_h1_locomotion.py demo script

Issues Found:

  • The new H1 demo script has hardcoded num_obstacles = 10 that ignores the --num_objects CLI argument

Confidence Score: 4/5

  • This PR is safe to merge after fixing the CLI argument issue in the H1 demo script
  • The migration from IsaacSim to IsaacLab SimulationContext is systematic and consistent across all files. The PyTorch tensor fix addresses a real deprecation issue. However, there's a logical bug where the CLI argument is defined but not used in the new demo script
  • Pay close attention to source/isaaclab/test/sensors/check_multi_mesh_ray_caster_h1_locomotion.py - the --num_objects CLI argument is ignored due to hardcoded value

Important Files Changed

Filename Overview
source/isaaclab/test/sensors/check_multi_mesh_ray_caster.py Fixed deprecated torch.Tensor(0) usage to torch.zeros(1) and changed default num_objects from 0 to 20
source/isaaclab/test/sensors/check_multi_mesh_ray_caster_h1_locomotion.py New demo script with H1 robot and multi-mesh ray caster - hardcoded obstacle count in config class doesn't match CLI argument
source/isaaclab/test/sim/test_simulation_context.py Removed deprecated IsaacSim SimulationContext import and related singleton tests

Sequence Diagram

sequenceDiagram
    participant User
    participant AppLauncher
    participant H1Demo
    participant ManagerBasedRLEnv
    participant SimulationContext
    participant Scene
    participant MultiMeshRayCaster
    participant H1Robot

    User->>AppLauncher: Launch with --num_objects arg
    AppLauncher->>H1Demo: Initialize H1RoughDemoWithRayCaster
    H1Demo->>H1Demo: Load H1RoughEnvCfg_PLAY_WITH_RAYCASTER
    Note over H1Demo: Bug: num_obstacles hardcoded to 10<br/>ignores args_cli.num_objects
    H1Demo->>H1Demo: Create obstacle configs (0 to num_obstacles)
    H1Demo->>H1Demo: Configure MultiMeshRayCasterCfg
    Note over H1Demo: Ray caster attached to Robot/torso_link<br/>with 5x5m grid pattern
    H1Demo->>ManagerBasedRLEnv: Create environment
    ManagerBasedRLEnv->>SimulationContext: Initialize simulation
    ManagerBasedRLEnv->>Scene: Setup scene with robot and obstacles
    Scene->>H1Robot: Spawn robot at origin
    loop For each obstacle
        Scene->>Scene: Spawn obstacle_i with random size/position
    end
    Scene->>MultiMeshRayCaster: Create ray caster sensor
    MultiMeshRayCaster->>MultiMeshRayCaster: Setup raycast targets<br/>/World/ground<br/>/World/envs/env_.*/obstacle_.*
    H1Demo->>H1Demo: Load pretrained policy
    loop Simulation Loop
        User->>H1Demo: Step simulation
        H1Demo->>H1Robot: Get observations
        H1Demo->>H1Demo: Run policy inference
        H1Demo->>ManagerBasedRLEnv: Execute actions
        ManagerBasedRLEnv->>MultiMeshRayCaster: Update ray caster (50Hz)
        MultiMeshRayCaster->>MultiMeshRayCaster: Cast rays in 5x5m grid
        MultiMeshRayCaster->>Scene: Detect ground and obstacles
        MultiMeshRayCaster-->>H1Demo: Return distance data
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile


# Add obstacles individually to the scene
# Default number of obstacles
num_obstacles = 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded num_obstacles = 10 in __post_init__ ignores the --num_objects CLI argument. The CLI arg on line 34 is parsed but never used.

Suggested change
num_obstacles = 10
num_obstacles = args_cli.num_objects if hasattr(args_cli, 'num_objects') else 10

Signed-off-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
sim = SimulationContext(
physics_dt=1.0 / 60.0, rendering_dt=1.0 / 60.0, sim_params=sim_params, backend="torch", device="cuda:0"
)
sim = SimulationContext(SimulationCfg())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be undone. It is isaacsim script.

@Mayankm96 Mayankm96 changed the title Fixes check multi mesh raycaster script and adds additional check script with raycaster attached to H1 robot Adds check script with raycaster attached to H1 robot Jan 29, 2026
Copy link
Contributor

@Mayankm96 Mayankm96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Isaac Sim script needs to be fixed. Those scripts are minimal repros using Isaac Sim for their team so shouldn't have Isaac Lab code in there.

Other than that, the demo looks pretty cool! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants