Skip to content

Commit 5fde764

Browse files
authored
[BUG FIX] Fix contacts_info (#1355)
1 parent b6aa20e commit 5fde764

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

genesis/engine/solvers/rigid/collider_decomp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,7 +2072,7 @@ def get_contacts(self, as_tensor: bool = True, to_torch: bool = True):
20722072
# Early return if already pre-computed
20732073
contacts_info = self._contacts_info_cache.get((as_tensor, to_torch))
20742074
if contacts_info is not None:
2075-
return contacts_info
2075+
return contacts_info.copy()
20762076

20772077
# Find out how much dynamic memory must be allocated
20782078
n_contacts = tuple(self.n_contacts.to_numpy())
@@ -2140,7 +2140,7 @@ def get_contacts(self, as_tensor: bool = True, to_torch: bool = True):
21402140
# Cache contact information before returning
21412141
self._contacts_info_cache[(as_tensor, to_torch)] = contacts_info
21422142

2143-
return contacts_info
2143+
return contacts_info.copy()
21442144

21452145
@ti.kernel
21462146
def _kernel_get_contacts(self, is_padded: ti.template(), iout: ti.types.ndarray(), fout: ti.types.ndarray()):

0 commit comments

Comments
 (0)