Skip to content

5. User tabs

Manousos Linardakis edited this page Aug 27, 2023 · 1 revision

User Tabs

5.0 User Tabs

The web simulator utilizes a Flask server as its backend, offering two separate endpoints accessible through the web browser, each serving a distinct purpose. The first tab can be found at /godot, providing a fullscreen view, while the second is available at /godotcode.

Each tab has its own simulator instance and both (tabs) are equipped with the corresponding session ID from the SocketIO server, allowing users to seamlessly connect to the simulator of each tab from their script. For more information about the session implementation within the server, please refer to the Socketio Server section of this wiki.

5.1 Fullscreen Tab

Fullscreen Tab

This tab provides users with a fullscreen view of the simulation environment. For optimal usage, it is recommended to utilize the godot library I have implemented in Python, which you can find here. To connect to this specific tab, users should copy and paste the session ID displayed on the tab into the godot fossbot class. This tab is located in the /godot endpoint.

5.2 Javascript Code Editor and Real-Time Execution

Javascript Tab

The second tab enables users to utilize javascript to write code directly in the browser's text area. This feature empowers users to execute their javascript code in real-time, creating a dynamic and interactive environment for experimentation. Even when using the Python library, users can still connect to this tab and try the fossbot functions by using the session ID from the tab. This tab is located in the /godotcode endpoint. To run the specified javascript code, click on the execute button of the /godotcode tab. You can view the javascript library documentation in the Javascript library section of this wiki.

5.3 Multiple Tabs and Session Management

The web simulator introduces the capability of handling multiple simulations simultaneously through separate tabs. Each time a new tab is opened, an independent simulator is created from scratch, allowing users to work on different scenarios concurrently.

It is also important to notice, because of the WebGL that the simulator is exported as, the user should have the tabs visible to ensure that the execution continues. This is also recommended from the godot docs.

5.4 Optimal Testing and Experimentation

Many fossbot levels

The ability to run multiple simulations simultaneously (by copying the corresponding session id of the tab) empowers users to compare different scenarios and strategies, making it an ideal platform for testing and experimentation. Users can explore various interactions between fossbots, obstacles, and the environment, gaining valuable insights into their robot designs and control algorithms.