Repository navigation
Conversation
|
@raidenLight I think we are missing a test for this feature. Could we have that too in the MR? Also need to update the CHANGELOG and extension.toml file. Thanks again! |
|
Hi, thanks @raidenLight for the PR, Are you willing add test case for this new feature? Let me know if you need help : )) |
@Mayankm96 @ooctipus Thank you for your suggestions! This is my first time using git-pull, and I'm not entirely sure how to add tests (is it something like source/isaaclab/test/sensors/check_ray_caster.py?), or how to update the CHANGELOG and extension.toml file. I'll be very glad if you could give me a brief explanation :) |
|
@raidenLight Ahh, I just check, since we don't have ray_caster test yet, and this is your first time starting pull request, I think it is a bit too much to ask you to come with tests on your own. I think what will be nice instead will be printing the ray_distances in
For the changelog, since raycaster.py is isaaclab.sensor.RayCaster, you would want to add a new entry in Then increment the package version in source/isaaclab/config/extension.toml to the number you put in CHANGELOG : )) |
@ooctipus Thank you very much for your patient help! I have added a simple output of Additionally, I created a new simple example I'm not sure if it's necessary, but I hope it can be helpful. : )) |
Greptile Summary
Important Files Changed
Confidence score: 4/5
Sequence DiagramsequenceDiagram
participant User
participant RayCaster
participant RayCasterData
participant WarPUtils
participant PhysicsEngine
User->>RayCaster: "Create RayCaster with track_ray_distance=True"
RayCaster->>RayCaster: "__init__(cfg)"
RayCaster->>RayCaster: "_initialize_impl()"
RayCaster->>RayCaster: "_initialize_warp_meshes()"
RayCaster->>WarPUtils: "convert_to_warp_mesh(vertices, faces)"
WarPUtils-->>RayCaster: "wp_mesh"
RayCaster->>RayCaster: "_initialize_rays_impl()"
RayCaster->>RayCasterData: "Initialize ray_distance buffer"
RayCaster-->>User: "RayCaster instance"
User->>RayCaster: "sensor.data (access ray distances)"
RayCaster->>RayCaster: "_update_outdated_buffers()"
RayCaster->>RayCaster: "_update_buffers_impl(env_ids)"
RayCaster->>RayCaster: "_update_ray_infos(env_ids)"
RayCaster->>PhysicsEngine: "obtain_world_pose_from_view()"
PhysicsEngine-->>RayCaster: "pos_w, quat_w"
RayCaster->>WarPUtils: "raycast_mesh(ray_starts, ray_directions, max_dist, return_distance=True)"
WarPUtils-->>RayCaster: "ray_hits_w, ray_distance"
RayCaster->>RayCasterData: "Update ray_distance buffer"
RayCaster-->>User: "RayCasterData with ray distances"
|
There was a problem hiding this comment.
Additional Comments (4)
-
scripts/tutorials/04_sensors/run_ray_caster.py, line 126 (link)logic: Accessing
ray_caster.data.ray_distancebefore callingray_caster.update()may return stale or uninitialized data. Should this line be moved after theray_caster.update()call to ensure fresh data? -
source/isaaclab/docs/CHANGELOG.rst, line 10-11 (link)syntax: Missing space after 'property' before :attr: directive. Should be 'property :attr:
~isaaclab.sensors.RayCasterCfg.track_ray_distance.' -
source/isaaclab/isaaclab/sensors/ray_caster/ray_caster_data.py, line 30 (link)style: Property name
ray_distanceshould be pluralray_distancesto match the existing pattern used inray_hits_w(plural) and the documentation that mentions "distances for all rays"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!
-
source/isaaclab/isaaclab/sensors/ray_caster/ray_caster.py, line 238-240 (link)syntax: Uses
self._deviceinstead ofself.device- should be consistent with the pattern used elsewhere in the file
8 files reviewed, 4 comments
2ef7fc8 to
f3061a4
Compare


Description
This PR adds an optional
ray_distancesproperty toRayCasterDatato directly provide Euclidean distances for all rays. This eliminates the need for users to manually calculate distances in every implementation, reducing boilerplate code and potential errors in RL environments.Key changes:
ray_distancesproperty from existing raycast datacfg.max_distanceto match existing conventionsFixes #2946
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatCONTRIBUTORS.md