Unverified Commit 83e14f09 authored by rumblingturtle's avatar rumblingturtle Committed by GitHub

Fixes missing asgument in calls to ConactSensor.find_bodies (#341)

# Description

Commit 3acff1be 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
parent dfa74872
...@@ -138,17 +138,17 @@ class ContactSensor(SensorBase): ...@@ -138,17 +138,17 @@ class ContactSensor(SensorBase):
self._data.current_contact_time[env_ids] = 0.0 self._data.current_contact_time[env_ids] = 0.0
self._data.last_contact_time[env_ids] = 0.0 self._data.last_contact_time[env_ids] = 0.0
def find_bodies(self, name_keys: str | Sequence[str]) -> tuple[list[int], list[str]]: def find_bodies(self, name_keys: str | Sequence[str], preserve_order: bool = False) -> tuple[list[int], list[str]]:
"""Find bodies in the articulation based on the name keys. """Find bodies in the articulation based on the name keys.
Args: Args:
name_keys: A regular expression or a list of regular expressions name_keys: A regular expression or a list of regular expressions to match the body names.
to match the body names. preserve_order: Whether to preserve the order of the name keys in the output. Defaults to False.
Returns: Returns:
A tuple of lists containing the body indices and names. A tuple of lists containing the body indices and names.
""" """
return string_utils.resolve_matching_names(name_keys, self.body_names) return string_utils.resolve_matching_names(name_keys, self.body_names, preserve_order)
def compute_first_contact(self, dt: float, abs_tol: float = 1.0e-8) -> torch.Tensor: def compute_first_contact(self, dt: float, abs_tol: float = 1.0e-8) -> torch.Tensor:
"""Checks if bodies that have established contact within the last :attr:`dt` seconds. """Checks if bodies that have established contact within the last :attr:`dt` seconds.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment