def check_termination(self):
        """ Check if environments need to be reset
        """
        reset_buf_collision = torch.any(torch.norm(self.contact_forces[:, self.termination_contact_indices, :], dim=-1) > 1., dim=1)
        reset_buf_fall = self.base_pos[:, 2] < self.ball_radius
        self.reset_buf = torch.logical_or(reset_buf_collision, reset_buf_fall)

        self.time_out_buf = self.episode_length_buf > self.cfg.env.max_episode_length  # no terminal reward for time-outs
        self.reset_buf |= self.time_out_buf
        if self.cfg.rewards.use_terminal_body_height:
            self.body_height_buf = torch.mean(self.root_states[self.robot_actor_idxs, 2].unsqueeze(1) - self.measured_heights, dim=1) \
                                   < self.cfg.rewards.terminal_body_height
            self.reset_buf = torch.logical_or(self.body_height_buf, self.reset_buf)
        if self.cfg.rewards.use_terminal_roll_pitch:
            self.body_ori_buf = torch.sum(torch.square(self.projected_gravity[:, :2]), dim=1) \
                                > self.cfg.rewards.terminal_body_ori
            self.reset_buf = torch.logical_or(self.body_ori_buf, self.reset_buf)
 Check if environments need to be reset
        
globe_walking/go1_gym/envs/base/legged_robot.py