def _post_process_config(self, config):
        """Add more special process to merged config"""
        # Cancel interface panel
        self.logger.info("Environment: {}".format(self.__class__.__name__))
        self.logger.info("MetaDrive version: {}".format(VERSION))
        if not config["show_interface"]:
            config["interface_panel"] = []

        # Adjust terrain
        n = config["map_region_size"]
        assert (n & (n - 1)) == 0 and 512 <= n <= 4096, "map_region_size should be pow of 2 and < 2048."
        TerrainProperty.map_region_size = config["map_region_size"]

        # Multi-Thread
        # if config["image_on_cuda"]:
        #     self.logger.info("Turn Off Multi-thread rendering due to image_on_cuda=True")
        #     config["multi_thread_render"] = False

        # Optimize sensor creation in none-screen mode
        if not config["use_render"] and not config["image_observation"]:
            filtered = {}
            for id, cfg in config["sensors"].items():
                if len(cfg) > 0 and not issubclass(cfg[0], BaseCamera) and id != "main_camera":
                    filtered[id] = cfg
            config["sensors"] = filtered
            config["interface_panel"] = []

        # Check sensor existence
        if config["use_render"] or "main_camera" in config["sensors"]:
            config["sensors"]["main_camera"] = ("MainCamera", *config["window_size"])

        # Merge dashboard config with sensors
        to_use = []
        if not config["render_pipeline"] and config["show_interface"] and "main_camera" in config["sensors"]:
            for panel in config["interface_panel"]:
                if panel == "dashboard":
                    config["sensors"]["dashboard"] = (DashBoard, )
                if panel not in config["sensors"]:
                    self.logger.warning(
                        "Fail to add sensor: {} to the interface. Remove it from panel list!".format(panel)
                    )
                elif panel == "main_camera":
                    self.logger.warning("main_camera can not be added to interface_panel, remove")
                else:
                    to_use.append(panel)
        config["interface_panel"] = to_use

        # Merge default sensor to list
        sensor_cfg = self.default_config()["sensors"].update(config["sensors"])
        config["sensors"] = sensor_cfg

        # show sensor lists
        _str = "Sensors: [{}]"
        sensors_str = ""
        for _id, cfg in config["sensors"].items():
            sensors_str += "{}: {}{}, ".format(_id, cfg[0] if isinstance(cfg[0], str) else cfg[0].__name__, cfg[1:])
        self.logger.info(_str.format(sensors_str[:-2]))

        # determine render mode automatically
        if config["use_render"]:
            assert "main_camera" in config["sensors"]
            config["_render_mode"] = RENDER_MODE_ONSCREEN
        else:
            config["_render_mode"] = RENDER_MODE_NONE
            for sensor in config["sensors"].values():
                if sensor[0] == "MainCamera" or (issubclass(sensor[0], BaseCamera) and sensor[0] != DashBoard):
                    config["_render_mode"] = RENDER_MODE_OFFSCREEN
                    break
        self.logger.info("Render Mode: {}".format(config["_render_mode"]))
        self.logger.info("Horizon (Max steps per agent): {}".format(config["horizon"]))
        if config["truncate_as_terminate"]:
            self.logger.warning(
                "When reaching max steps, both 'terminate' and 'truncate will be True."
                "Generally, only the `truncate` should be `True`."
            )
        return config
Add more special process to merged config
metadrive/envs/base_env.py