def _save_episode(self):
        """
        Save the episode data to a JSON file.
        """
        self.data['info'] = self.info
        self.data['text'] = self.text
        self.data['data'] = self.episode_data
        with open(self.json_path, 'w', encoding='utf-8') as jsonf:
            jsonf.write(json.dumps(self.data, indent=4, ensure_ascii=False))
        self.need_save = False  # Reset the save flag
        self.is_available = True  # Mark the class as available after saving
        print(f"==> Episode saved successfully to {self.json_path}.")

        Save the episode data to a JSON file.
        
deploy/teleop/utils/episode_writer.py