Skip to content

Commit

Permalink
Fixes missing max raycast distance in RayCaster sensor (#48)
Browse files Browse the repository at this point in the history
# Description

This MR fixes a minor issue where the max raycast distance in the config was ignored
in the raycaster sensor.

## Type of change

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

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have run all the tests with `./orbit.sh --test` and they pass
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: Pascal <[email protected]>
  • Loading branch information
renezurbruegg and pascal-roth authored Jan 23, 2024
1 parent 8225831 commit b579c50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def _update_buffers_impl(self, env_ids: Sequence[int]):
self._data.ray_hits_w[env_ids] = raycast_mesh(
ray_starts_w,
ray_directions_w,
max_dist=self.cfg.max_distance,
mesh=RayCaster.meshes[self.cfg.mesh_prim_paths[0]],
)[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class OffsetCfg:
pattern_cfg: PatternBaseCfg = MISSING
"""The pattern that defines the local ray starting positions and directions."""

max_distance: float = 100.0
"""Maximum distance (in meters) from the sensor to ray cast to. Defaults to 100.0."""
max_distance: float = 1e6
"""Maximum distance (in meters) from the sensor to ray cast to. Defaults to 1e6."""

drift_range: tuple[float, float] = (0.0, 0.0)
"""The range of drift (in meters) to add to the ray starting positions (xyz). Defaults to (0.0, 0.0).
Expand Down

0 comments on commit b579c50

Please sign in to comment.