I have the following code.
def _reset_dofs(self, env_ids):
self.dof_pos[env_ids] = self.default_dof_pos * torch_rand_float(0.9, 1.1,
(len(env_ids), self.num_dof),
device=self.device)
self.dof_vel[env_ids] = 0.
env_ids_int32 = env_ids.clone().to(dtype=torch.int32)
self.gym.set_dof_state_tensor_indexed(self.sim,
gymtorch.unwrap_tensor(self.dof_state),
gymtorch.unwrap_tensor(env_ids_int32),
len(env_ids_int32))
def reset_idx(self, env_ids):
self._reset_dofs(env_ids)
print(self.robot_root_states)
self._reset_root_states(env_ids)
I can’t access the robot_root_states anymore after calling the reset_dofs(). I get the following error.
RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA
to enable device-side assertions.
The problem seems to be with set_dof_state_tensor_indexed. Please help!