Skip to content
Snippets Groups Projects
Commit c4c041b3 authored by MasterScrat's avatar MasterScrat
Browse files

Merge branch 'bugfix/visualize_for_envs' into 'master'

Fixed visualize=True condition to render only for envs requested for

See merge request flatland/flatland!305
parents 7e4792a2 781d20ea
No related branches found
No related tags found
No related merge requests found
......@@ -535,9 +535,11 @@ class FlatlandRemoteEvaluationService:
)
if self.visualize:
if self.env_renderer:
del self.env_renderer
self.env_renderer = RenderTool(self.env, gl="PILSVG", )
current_env_path = self.env_file_paths[self.simulation_count]
if current_env_path in self.video_generation_envs:
self.env_renderer = RenderTool(self.env, gl="PILSVG", )
elif self.env_renderer:
self.env_renderer = False
_command_response = {}
_command_response['type'] = messages.FLATLAND_RL.ENV_CREATE_RESPONSE
......@@ -631,17 +633,18 @@ class FlatlandRemoteEvaluationService:
# Record Frame
if self.visualize:
self.env_renderer.render_env(
show=False,
show_observations=False,
show_predictions=False
)
"""
Only save the frames for environments which are separately provided
Only generate and save the frames for environments which are separately provided
in video_generation_indices param
"""
current_env_path = self.env_file_paths[self.simulation_count]
if current_env_path in self.video_generation_envs:
self.env_renderer.render_env(
show=False,
show_observations=False,
show_predictions=False
)
self.env_renderer.gl.save_image(
os.path.join(
self.vizualization_folder_name,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment