Skip to main content

RoSys - The Robot System

RoSys provides an easy-to-use robot system. Its purpose is similar to ROS. But RoSys is fully based on modern web technologies and focusses on mobile robotics.

The full documentation is available at rosys.io.

Principles

All Python

Python is great to write business logic. Computation-heavy tasks are wrapped in processes, accessed through WebSockets or called via C++ bindings. Like you would do in any other Python program.

Modularity

You can structure your code as you please. RoSys provides its magic without assuming a specific file structure, configuration files or enforced naming.

Event Loop

Thanks to asyncio you can write your business logic without locks and mutexes. The execution is parallel but not concurrent which makes it easier to read, write and debug. In real-case scenarios this is also much faster than ROS. Its multiprocessing architecture requires too much inter-process communication.

Web UI

Most machines need some kind of human interaction. RoSys is built from the ground up to make sure your robot can be operated fully off the grid with any web browser. This is done by incorporating NiceGUI, a wonderful all-Python UI web framework. It is also possible to proxy the user interface through a gateway for remote operation.

Simulation

Robot hardware is often slower than your own computer. To rapidly test out new behavior and algorithms, RoSys provides a simulation mode. Here, all hardware is mocked and can even be manipulated to test wheel blockages and similar.

Testing

You can use pytest to write high-level integration tests. It is based on the above-described simulation mode and accelerates the robot's time for super fast execution.

Architecture and Features

Modules

RoSys modules are just Python modules which encapsulate certain functionality. They can hold their own state, register lifecycle hooks, run methods repeatedly and subscribe to or raise events. Modules can depend on other modules which is mostly implemented by passing them into the constructor.

Lifecycle Hooks and Loops

Modules can register functions via rosys.on_startup or rosys.on_shutdown as well as repeatedly with a given interval with rosys.on_repeat.

The lifetime of such a repetition is derived from the type of the callback: a bound method repeats until its object is garbage-collected — the repeater does not keep the object alive, so its owner defines the lifetime of the repetition by storing it; a plain function repeats until shutdown. Lambdas, capturing closures and partials are rejected because no single lifetime rule fits them.

For a bound method, "storing" means keeping a strong reference to the object: a module kept in your robot assembly repeats until shutdown, while a short-lived object stops as soon as it is discarded.

rosys.on_shutdown follows the same rule for bound methods — they are held weakly and simply skipped if their object has been discarded — while plain functions, lambdas and other callables are held strongly and run at shutdown.

class Camera:
    def __init__(self) -> None:
        rosys.on_repeat(self.step, 0.1)  # ends when this camera is dropped

    def step(self) -> None:
        ...


cameras: dict[str, Camera] = {}
cameras['front'] = Camera()  # stored, so it repeats
del cameras['front']         # dropped, so the repetition ends without leaking

Events

Modules can provide events to allow connecting otherwise separated modules of the system. For example, one module might read sensor data and raise an event NEW_SENSOR_DATA, without knowing of any consumers. Another module can register on NEW_SENSOR_DATA and act accordingly when being called.

Automations

RoSys provides an Automator module for running "automations". Automations are coroutines that can not only be started and stopped, but also paused and resumed, e.g. using AutomationControls. Have a look at our Click-and-drive example.

Persistence

Modules can register backup and restore methods to read and write their state to disk.

Time

RoSys uses its own time which is accessible through rosys.time. This way the time can advance much faster in simulation and tests if no CPU-intensive operation is performed. To delay the execution of a coroutine, you should invoke await rosys.sleep(seconds: float). This creates a delay until the provided amount of RoSys time has elapsed.

Threading and Multiprocessing

RoSys makes extensive use of async/await to achieve parallelism without threading or multiprocessing. But not every piece of code you want to integrate is offering an asyncio interface. Therefore RoSys provides two handy wrappers:

IO-bound: If you need to read from an external device or use a non-async HTTP library like requests, you should wrap the code in a function and await it with await rosys.run.io_bound(...).

CPU-bound: If you need to do some heavy computation and want to spawn another process, you should wrap the code in a function and await it with await rosys.run.cpu_bound(...).

RoSys starts helper processes (MJPEG stream workers, path planning) with the spawn start method, which re-imports your main script in the child. A script that creates these at import time must therefore put its startup under if __name__ == '__main__':, or the helpers start recursively.

Safety

Python (and Linux) is fast enough for most high-level logic, but has no realtime guarantees. Safety-relevant behavior should therefore be put on a suitable microcontroller. It governs the hardware of the robot and must be able to perform safety actions like triggering emergency hold etc.

We suggest to use an industrial PC with an integrated controller like the Zauberzeug Robot Brain. It provides a Linux system to run RoSys, offers AI acceleration via NVidia Jetson, two integrated ESP32 microcontrollers and six I/O sockets with up to 24 GPIOs for digital I/Os, CAN, RS485, SPI, I2C, etc. It also has two hardware ENABLE switches and one which is controllable via software.

To have flexible configuration for the microcontroller we created another open source project called Lizard. It is a domain-specific language interpreted by the microcontroller which enables you to write reactive hardware behavior without recompiling and flashing.

User Interface

RoSys builds upon the open source project NiceGUI and offers many robot-related UI elements. NiceGUI is a high-level UI framework for the web. This means you can write all UI code in Python and the state is automatically reflected in the browser through WebSockets. See any of our examples.

RoSys can also be used with other user interfaces or interaction models if required, for example a completely app-based control through Bluetooth Low Energy with Flutter.

Notifications

Modules can notify the user through rosys.notify('message to the user'). When using NiceGUI, the notifications will show as snackbar messages. The history of notifications is stored in the list rosys.notifications.

Contributing

Thank you for your interest in contributing to RoSys! We are thrilled to have you on board and appreciate your efforts to make this project even better.

As a growing open-source project, we understand that it takes a community effort to achieve our goals. That's why we welcome all kinds of contributions, no matter how small or big they are. Whether it's adding new features, fixing bugs, improving documentation, or suggesting new ideas, we believe that every contribution counts and adds value to our project.

We have provided a detailed guide on how to contribute to RoSys in our CONTRIBUTING.md file. We encourage you to read it carefully before making any contributions to ensure that your work aligns with the project's goals and standards.

If you have any questions or need help with anything, please don't hesitate to reach out to us. We are always here to support and guide you through the contribution process.

Metadata

Release files for rosys 0.36.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rosys 0.36.0
File Size Uploaded
rosys-0.36.0.tar.gz 330.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rosys 0.36.0
File Interpreter ABI Platform
rosys-0.36.0-py3-none-any.whl Python 3 none any Details

Total release size: 748.4 kB

Release files / rosys-0.36.0.tar.gz

Download URL rosys-0.36.0.tar.gz
Size 330.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bd503fceda0e2e14beb4e54a986d1e2bc5a9ef2b0c710d1a1d1b629f39b1160d
BLAKE2b-256 checksum
How to use checksums
6d65a0c37c32360d2d27423cc8e923895d35c6047f68818c6a28f00db9071ec2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / rosys-0.36.0-py3-none-any.whl

Download URL rosys-0.36.0-py3-none-any.whl
Size 418.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7311113ac2ac6193fd97236e0939d52a35f230025b478e266ed3c819f8c97492
BLAKE2b-256 checksum
How to use checksums
b1b3b85b0926b53423af672faa8a1c68cb11619b2892d586d2c688d4ea153cc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.36.0 This release

2 release files

0.34.0

2 release files

0.33.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.2

2 release files

0.22.1

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.19.0

2 release files

0.18.6

2 release files

0.18.5

2 release files

0.18.4

2 release files

0.18.3

2 release files

0.18.2

2 release files

0.18.1

2 release files

0.18.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.9

2 release files

0.10.8

2 release files

0.10.5

2 release files

0.10.2

2 release files

0.10.0

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.6.21

2 release files

0.6.20

2 release files

0.6.18

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.19

2 release files

0.5.18

2 release files

0.5.17

2 release files

0.5.14

2 release files

0.5.13

2 release files

0.5.12

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.13

2 release files

0.4.11

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page