Skip to content

Commit 83e14f0

Browse files
Fixes missing asgument in calls to ConactSensor.find_bodies (#341)
# Description Commit 3acff1b missed update for a ContactSensor override to find_bodies ## 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` - [ ] 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 - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
1 parent dfa7487 commit 83e14f0

File tree

1 file changed

+4
-4
lines changed
  • source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/contact_sensor

1 file changed

+4
-4
lines changed

source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/contact_sensor/contact_sensor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,17 @@ def reset(self, env_ids: Sequence[int] | None = None):
138138
self._data.current_contact_time[env_ids] = 0.0
139139
self._data.last_contact_time[env_ids] = 0.0
140140

141-
def find_bodies(self, name_keys: str | Sequence[str]) -> tuple[list[int], list[str]]:
141+
def find_bodies(self, name_keys: str | Sequence[str], preserve_order: bool = False) -> tuple[list[int], list[str]]:
142142
"""Find bodies in the articulation based on the name keys.
143143
144144
Args:
145-
name_keys: A regular expression or a list of regular expressions
146-
to match the body names.
145+
name_keys: A regular expression or a list of regular expressions to match the body names.
146+
preserve_order: Whether to preserve the order of the name keys in the output. Defaults to False.
147147
148148
Returns:
149149
A tuple of lists containing the body indices and names.
150150
"""
151-
return string_utils.resolve_matching_names(name_keys, self.body_names)
151+
return string_utils.resolve_matching_names(name_keys, self.body_names, preserve_order)
152152

153153
def compute_first_contact(self, dt: float, abs_tol: float = 1.0e-8) -> torch.Tensor:
154154
"""Checks if bodies that have established contact within the last :attr:`dt` seconds.

0 commit comments

Comments
 (0)