def _post_physics_step_callback(self):
        """ Callback called before computing terminations, rewards, and observations
            Default behaviour: Compute ang vel command based on target and heading, compute measured terrain heights and randomly push robots
        """

        # teleport robots to prevent falling off the edge
        self._teleport_robots(torch.arange(self.num_envs, device=self.device), self.cfg)

        # resample commands
        sample_interval = int(self.cfg.commands.resampling_time / self.dt)
        env_ids = (self.episode_length_buf % sample_interval == 0).nonzero(as_tuple=False).flatten()

        if self.cfg.commands.num_commands > 0:
            self._resample_commands(env_ids)
            self._step_contact_targets()
        
        if self.cfg.commands.heading_command:
            forward = quat_apply(self.base_quat, self.forward_vec)
            heading = torch.atan2(forward[:, 1], forward[:, 0]) - self.heading_offsets
            self.commands[:, 2] = torch.clip(0.5 * wrap_to_pi(self.heading_commands - heading), -1., 1.)

        # measure terrain heights
        if self.cfg.perception.measure_heights:
            self.measured_heights = self.heightmap_sensor.get_observation()

        # push robots
        self._push_robots(torch.arange(self.num_envs, device=self.device), self.cfg)
        self._push_balls(torch.arange(self.num_envs, device=self.device), self.cfg)

        # We check modulos 1 (instead of 0) in order to reset at the very start, when common set counter is 1
        if self.common_step_counter % int(self.cfg.domain_rand.gravity_rand_interval) == 1:
            self._randomize_gravity()
        if self.common_step_counter % int(self.cfg.domain_rand.ball_drag_rand_interval) == 1:
            self._randomize_ball_drag()
        if self.common_step_counter % int(self.cfg.domain_rand.lag_timesteps_rand_interval) == 1:
            self._randomize_lag_timesteps()
 Callback called before computing terminations, rewards, and observations
            Default behaviour: Compute ang vel command based on target and heading, compute measured terrain heights and randomly push robots
        
globe_walking/go1_gym/envs/base/legged_robot.py