Skip to content
Snippets Groups Projects
Commit ea81304c authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

#119 refactored

parent d80386a8
No related branches found
No related tags found
No related merge requests found
...@@ -293,7 +293,8 @@ class RenderTool(object): ...@@ -293,7 +293,8 @@ class RenderTool(object):
for visited_cell in prediction_dict[agent]: for visited_cell in prediction_dict[agent]:
cell_coord = array(visited_cell[:2]) cell_coord = array(visited_cell[:2])
cell_coord_trans = np.matmul(cell_coord, rt.row_col_to_xy) + rt.x_y_half cell_coord_trans = np.matmul(cell_coord, rt.row_col_to_xy) + rt.x_y_half
self._draw_square(cell_coord_trans, 1 / (agent + 1.1), color, layer=1, opacity=100) # TODO : Track highlighting (Adrian) self._draw_square(cell_coord_trans, 1 / (agent + 1.1), color, layer=1, opacity=100)
# TODO : Track highlighting (Adrian)
def render_rail(self, spacing=False, rail_color="gray", curves=True, arrows=False): def render_rail(self, spacing=False, rail_color="gray", curves=True, arrows=False):
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Railway Scene Editor # Railway Scene Editor
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from IPython.core.display import display, HTML from IPython.core.display import display, HTML
display(HTML("<style>.container { width:95% !important; }</style>")) display(HTML("<style>.container { width:95% !important; }</style>"))
``` ```
%% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from flatland.utils.editor import EditorMVC from flatland.utils.editor import EditorMVC
mvc = EditorMVC(sGL="PIL" ) mvc = EditorMVC(sGL="PILSVG" )
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Instructions ## Instructions
- Drag to draw (improved dead-ends) - Drag to draw (improved dead-ends)
- ctrl-click to add agent or select agent - ctrl-click to add agent or select agent
- if agent is selected: - if agent is selected:
- ctrl-click to move agent position - ctrl-click to move agent position
- use rotate agent to rotate 90° - use rotate agent to rotate 90°
- ctrl-shift-click to set target for selected agent - ctrl-shift-click to set target for selected agent
- target can be moved by repeating - target can be moved by repeating
- to Resize the env (cannot preserve work): - to Resize the env (cannot preserve work):
- select "Regen" tab, set regen size slider, click regenerate. - select "Regen" tab, set regen size slider, click regenerate.
- alt-click remove all rails from cell - alt-click remove all rails from cell
Demo Scene: complex_scene.pkl Demo Scene: complex_scene.pkl
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
mvc.view.display() mvc.view.display()
``` ```
%% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
......
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