def _get_observation(self):
        """
        Returns an OrderedDict containing observations [(name_string, np.array), ...].

        Important keys:
            robot-state: contains robot-centric information.
            object-state: requires @self.use_object_obs to be True.
                contains object-centric information.
            image: requires @self.use_camera_obs to be True.
                contains a rendered frame from the simulation.
            depth: requires @self.use_camera_obs and @self.camera_depth to be True.
                contains a rendered depth map from the simulation
        """
        di = super()._get_observation()
        # camera observations
        if self.use_camera_obs:
            camera_obs = self.sim.render(
                camera_name=self.camera_name,
                width=self.camera_width,
                height=self.camera_height,
                depth=self.camera_depth,
            )
            if self.camera_depth:
                di["image"], di["depth"] = camera_obs
            else:
                di["image"] = camera_obs

        # low-level object information
        if self.use_object_obs:
            # position and rotation of object
            cube_pos = self.sim.data.body_xpos[self.cube_body_id]
            cube_quat = T.convert_quat(
                self.sim.data.body_xquat[self.cube_body_id], to="xyzw"
            )
            di["cube_pos"] = cube_pos
            di["cube_quat"] = cube_quat

            di["l_eef_xpos"] = self._l_eef_xpos
            di["r_eef_xpos"] = self._r_eef_xpos
            di["handle_1_xpos"] = self._handle_1_xpos
            di["handle_2_xpos"] = self._handle_2_xpos
            di["l_gripper_to_handle"] = self._l_gripper_to_handle
            di["r_gripper_to_handle"] = self._r_gripper_to_handle

            di["object-state"] = np.concatenate(
                [
                    di["cube_pos"],
                    di["cube_quat"],
                    di["l_eef_xpos"],
                    di["r_eef_xpos"],
                    di["handle_1_xpos"],
                    di["handle_2_xpos"],
                    di["l_gripper_to_handle"],
                    di["r_gripper_to_handle"],
                ]
            )

        return di
def _get_observation ( self ) : di = super ( ) . _get_observation ( ) if self . use_camera_obs : camera_obs = self . sim . render ( camera_name = self . camera_name , width = self . camera_width , height = self . camera_height , depth = self . camera_depth , ) if self . camera_depth : di [ "image" ] , di [ "depth" ] = camera_obs else : di [ "image" ] = camera_obs if self . use_object_obs : cube_pos = self . sim . data . body_xpos [ self . cube_body_id ] cube_quat = T . convert_quat ( self . sim . data . body_xquat [ self . cube_body_id ] , to = "xyzw" ) di [ "cube_pos" ] = cube_pos di [ "cube_quat" ] = cube_quat di [ "l_eef_xpos" ] = self . _l_eef_xpos di [ "r_eef_xpos" ] = self . _r_eef_xpos di [ "handle_1_xpos" ] = self . _handle_1_xpos di [ "handle_2_xpos" ] = self . _handle_2_xpos di [ "l_gripper_to_handle" ] = self . _l_gripper_to_handle di [ "r_gripper_to_handle" ] = self . _r_gripper_to_handle di [ "object-state" ] = np . concatenate ( [ di [ "cube_pos" ] , di [ "cube_quat" ] , di [ "l_eef_xpos" ] , di [ "r_eef_xpos" ] , di [ "handle_1_xpos" ] , di [ "handle_2_xpos" ] , di [ "l_gripper_to_handle" ] , di [ "r_gripper_to_handle" ] , ] ) return di
Returns an OrderedDict containing observations [(name_string, np.array), ...].

        Important keys:
            robot-state: contains robot-centric information.
            object-state: requires @self.use_object_obs to be True.
                contains object-centric information.
            image: requires @self.use_camera_obs to be True.
                contains a rendered frame from the simulation.
            depth: requires @self.use_camera_obs and @self.camera_depth to be True.
                contains a rendered depth map from the simulation