def _reset_root_states(self, env_ids, cfg):
        """ Resets ROOT states position and velocities of selected environmments
            Sets base position based on the curriculum
            Selects randomized base velocities within -0.5:0.5 [m/s, rad/s]
        Args:
            env_ids (List[int]): Environemnt ids
        """
        robot_env_ids = self.robot_actor_idxs[env_ids].to(device=self.device)

        ### Reset robots
        self.root_states[robot_env_ids] = self.base_init_state
        self.root_states[robot_env_ids, :3] += self.env_origins[env_ids]
        self.root_states[robot_env_ids, 0:1] += torch_rand_float(-cfg.terrain.x_init_range, cfg.terrain.x_init_range,
                                                                 (len(robot_env_ids), 1), device=self.device)
        self.root_states[robot_env_ids, 1:2] += torch_rand_float(-cfg.terrain.y_init_range, cfg.terrain.y_init_range,
                                                                 (len(robot_env_ids), 1), device=self.device)
        self.root_states[robot_env_ids, 0] += cfg.terrain.x_init_offset
        self.root_states[robot_env_ids, 1] += cfg.terrain.y_init_offset
        self.root_states[robot_env_ids, 2] += self.ball_radius[env_ids] * 2 + 0.0001

        random_yaw_angle = 2*(torch.rand(len(env_ids), 3, dtype=torch.float, device=self.device,
                                                     requires_grad=False)-0.5)*torch.tensor([0, 0, cfg.terrain.yaw_init_range], device=self.device)
        self.root_states[robot_env_ids,3:7] = quat_from_euler_xyz(random_yaw_angle[:,0], random_yaw_angle[:,1], random_yaw_angle[:,2])
            
        self.root_states[robot_env_ids, 7:13] = torch_rand_float(-0.5, 0.5, (len(robot_env_ids), 6), device=self.device)  # [7:10]: lin vel, [10:13]: ang vel

        ### Reset objects
        object_env_ids = self.object_actor_idxs[env_ids].to(device=self.device)

        self.root_states[object_env_ids] = self.object_init_state
        self.root_states[object_env_ids, :3] += self.env_origins[env_ids]
        self.root_states[object_env_ids,2] += self.ball_radius[env_ids] + 0.0001
        # self.root_states[object_env_ids,0:3] += 2*(torch.rand(len(env_ids), 3, dtype=torch.float, device=self.device,
        #                                             requires_grad=False)-0.5) * torch.tensor(cfg.ball.init_pos_range,device=self.device,
        #                                             requires_grad=False)
        # self.root_states[object_env_ids,7:10] += 2*(torch.rand(len(env_ids), 3, dtype=torch.float, device=self.device,
        #                                             requires_grad=False)-0.5) * torch.tensor(cfg.ball.init_vel_range,device=self.device,
        #                                             requires_grad=False)
        self.root_states[object_env_ids,0:3] += torch.tensor(cfg.ball.init_pos_range,device=self.device, requires_grad=False)
        self.root_states[object_env_ids,7:10] += torch.tensor(cfg.ball.init_vel_range,device=self.device, requires_grad=False)

        all_subject_env_ids = torch.cat((robot_env_ids, object_env_ids)) if self.cfg.env.add_balls else robot_env_ids
        all_subject_env_ids_int32 = all_subject_env_ids.to(dtype=torch.int32)
        self.gym.set_actor_root_state_tensor_indexed(self.sim,
                                                     gymtorch.unwrap_tensor(self.root_states),
                                                     gymtorch.unwrap_tensor(all_subject_env_ids_int32), len(all_subject_env_ids_int32))

        if cfg.env.record_video and 0 in env_ids:
            if self.complete_video_frames is None:
                self.complete_video_frames = []
            else:
                self.complete_video_frames = self.video_frames[:]
            self.video_frames = []
 Resets ROOT states position and velocities of selected environmments
            Sets base position based on the curriculum
            Selects randomized base velocities within -0.5:0.5 [m/s, rad/s]
        Args:
            env_ids (List[int]): Environemnt ids
        
globe_walking/go1_gym/envs/base/legged_robot.py