From f047bcfdd6e14b7406af44904c9faeac8039ca55 Mon Sep 17 00:00:00 2001 From: Kevyn Kelso Date: Sat, 2 Mar 2024 16:13:49 -0700 Subject: [PATCH] fix: set traci default view if it doesn't exist --- sumo_rl/environment/env.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sumo_rl/environment/env.py b/sumo_rl/environment/env.py index 0919863d..2015bccf 100755 --- a/sumo_rl/environment/env.py +++ b/sumo_rl/environment/env.py @@ -236,6 +236,8 @@ def _start_simulation(self): self.sumo = traci.getConnection(self.label) if self.use_gui or self.render_mode is not None: + if "DEFAULT_VIEW" not in dir(traci.gui): + traci.gui.DEFAULT_VIEW = "View #0" self.sumo.gui.setSchema(traci.gui.DEFAULT_VIEW, "real world") def reset(self, seed: Optional[int] = None, **kwargs):