def add_policy_info(self, name, policy_class, *args, **kwargs):
        """
        Call when spawn new objects, ignore map related stuff
        """
        filtered_args = []
        for arg in args:
            filtered_args.append(arg) if not isinstance(arg, BaseObject) else filtered_args.append(BaseObject)
        filtered_kwargs = {}
        for k, v in kwargs.items():
            filtered_kwargs[k] = v if not isinstance(v, BaseObject) else BaseObject
        if self.engine.record_episode:
            assert name not in self.current_frame.policy_spawn_info, "Duplicated record!"
            self.current_frame.policy_spawn_info[name] = {
                PolicyState.POLICY_CLASS: policy_class,
                PolicyState.ARGS: filtered_args,
                PolicyState.KWARGS: filtered_kwargs,
                PolicyState.OBJ_NAME: name
            }

        Call when spawn new objects, ignore map related stuff
        
metadrive/manager/record_manager.py