From 26bcff7475bcc7b1412befb6d759da97953813a0 Mon Sep 17 00:00:00 2001
From: Gaetan Lepage <gaetan@glepage.com>
Date: Sat, 17 May 2025 14:41:32 +0200
Subject: [PATCH] rl/wer_map_env: only warn about dir map on first step

---
 rl_audio_nav/rl/environments/map_envs/wer_map_env.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/rl_audio_nav/rl/environments/map_envs/wer_map_env.py b/rl_audio_nav/rl/environments/map_envs/wer_map_env.py
index df5efa5..831c0a8 100644
--- a/rl_audio_nav/rl/environments/map_envs/wer_map_env.py
+++ b/rl_audio_nav/rl/environments/map_envs/wer_map_env.py
@@ -297,9 +297,11 @@ class RlanWerMapEnv(RlanEnv):
 
                 wer = wer_map_array[n_x, n_y, agent_orientation]
             else:
-                self._logger.warning(
-                    "Array is directional, but WER map isn't!\nFalling back to W[x, y] WER"
-                )
+                # Only warn on the first step, otherwise it is too verbose
+                if self.step_counter == 0:
+                    self._logger.warning(
+                        "Array is directional, but WER map isn't!\nFalling back to W[x, y] WER"
+                    )
                 wer = wer_map_array[n_x, n_y]
 
         else:
-- 
GitLab