Skip to content

Getting Started

First install RoSys with pip or Docker. Then create a directory to host your code and put it under version control. Name your entry file and add the following content:

#!/usr/bin/env python3
from nicegui import ui
import rosys
import rosys.ui

# setup
runtime = rosys.Runtime()
rosys.ui.configure(ui, runtime)

# keyboard control

# 3d scene
with ui.scene() as scene:
    robot = rosys.ui.robot_object()
ui.label('hold SHIFT to steer with the keyboard arrow keys')

# start'RoSys')

If you launch the program, your browser will open the url and present a 3d view:




The User Interface is built with NiceGUI. The imports must be stated separately to make it possible to run RoSys without it.


As you can read up in the "Architecture" chapter RoSys provides a runtime to manage the actors which operate on the world. The command rosys.ui.configure(ui, runtime) connects the user interface with the runtime.

Keyboard Control

By calling rosys.ui.keyboard_control() you create a keyboard event listener which will steer the robot. There are also other possibilities of steering the robot like a Joystick or clicking in the 3d scene.

3D Scene

As it is common for groups of UI elements in NiceGUI, a 3d scene is created by using context through Python's with statement. Every command "inside" is applied to the created scene. Here a 3d representation of the robot is created (rosys.ui.robot_object()). Then the ui.timer ensures its position is updated every 50 ms. A ui.label is used afterwards to explain the keyboard interaction. Note: The label is on the same intendation level as the ui.scene object, not within. See NiceGUI for a complete API reference.


NiceGUI provides a command which launches the webserver and presents the interface as configured above. If you modify the code, an automatic reload is triggered. This is very convenient, but can be deactivated by passing reload=False.