I am trying to realize a long-term decision task A in OmniIsaacGymEnvs, so I set dt to 1/60 s and control_frequency_inv to 180(execute every 3s). Besides I also want to execute another function B every world frame, so I add it to the control_frequency_inv loop. However I got the warning below.
2023-06-21 14:01:55 [69,210ms] [Warning] [omni.physx.tensors.plugin] GPU tensor function setRootTransforms: calling a setter after flush may result in incorrect values!
according to my test, the reason is the calling of set_joint_velocity_targets in function B. How can I avoid this warning?
my code where the functionB is added:
def step(self, actions):
if self._task.randomize_actions:
actions = self._task._dr_randomizer.apply_actions_randomization(actions=actions, reset_buf=self._task.reset_buf)
actions = torch.clamp(actions, -self._task.clip_actions, self._task.clip_actions).to(self._task.device).clone()
self._task.pre_physics_step(actions)
for _ in range(self._task.control_frequency_inv):
self._task.functionB()
self._world.step(render=self._render)
self.sim_frame_count += 1
self._obs, self._rew, self._resets, self._extras = self._task.post_physics_step()
if self._task.randomize_observations:
self._obs = self._task._dr_randomizer.apply_observations_randomization(
observations=self._obs.to(device=self._task.rl_device), reset_buf=self._task.reset_buf)
self._states = self._task.get_states()
self._process_data()
obs_dict = {"obs": self._obs, "states": self._states}
return obs_dict, self._rew, self._resets, self._extras