Skip to content
/ dora Public
forked from dora-rs/dora

low latency, composable, and distributed dataflow for AI and robotic application

License

Notifications You must be signed in to change notification settings

vovw/dora

 
 

Repository files navigation


What is dora-rs?

Dataflow-oriented robotic application (dora-rs) is a framework that makes creation of robotic applications fast and simple.

Building a robotic application can be summed up as bringing together hardwares, algorithms, and AI models, and make them communicate with each others. At dora-rs, we try to:

  • make integration of hardware and software easy by supporting Python, C, C++, and also ROS2.
  • make communication low latency by using zero-copy Arrow messages.

dora-rs is still experimental and you might experience bugs, but we're working very hard to make it stable as possible.

Performance

dora-rs can show impressive performance, up to 17x faster compared to current status quo ROS2 in Python! This is the result of using our own shared memory server and Apache Arrow to achieve zero copy data passing.

See: https://github.com/dora-rs/dora-benchmark/tree/main for reproduction.

Dataflow Paradignm

dora-rs implements a dataflow paradigm where tasks are split between nodes isolated as individual processes. Each node defines its inputs and outputs to connect with other nodes. The dataflow paradigm has the advantage of creating an abstraction layer that makes robotic applications modular and easily configurable.

Communication

Communication between nodes is handled with shared memory on a same machine and TCP on distributed machines. Our shared memory implementation tracks messages across processes and discards them when obsolete. Shared memory slots are cached to avoid new memory allocation.

Message Format

Nodes communicate with Apache Arrow Data Format.

Apache Arrow is a universal memory format for flat and hierarchical data. The Arrow memory format supports zero-copy reads for lightning-fast data access without serialization overhead. It defines a C data interface without any build-time or link-time dependency requirement, that means that dora-rs has no compilation step beyond the native compiler of your favourite language.

Opentelemetry

dora-rs uses Opentelemetry to record all your logs, metrics and traces. This means that the data and telemetry can be linked using a shared abstraction.

Opentelemetry is an open source observability standard that makes dora-rs telemetry collectable by most backend such as elasticseach, prometheus, Datadog..

Opentelemetry is language independent, backend agnostic, and easily collect distributed data, making it perfect for dora-rs applications.

Hot-Reloading

dora-rs implements Hot-Reloading for python which means you can change code at runtime in Python while keeping your state intact.

Using the feature flag: --attach --hot-reload, dora-rs watch for code change and reload nodes that has been modified. You can check fail-safe mecanism at: dora-rs#239

demo

Self-Coding Robot: Code RAG (WIP)

You can easily create a self-coding robot, by combining Hot-reloading with a Retrieval Augmented Generation (RAG) that is going to generate code modification from your prompt. See:examples/python-operator-dataflow

Self-Coding Robot is just the tip of the iceberg of robotics combined with llm, that we hope to power. There is so much more that we haven't explored yet like:

Installation

Quickest way:

cargo install dora-cli --locked
pip install dora-rs # For Python API

dora --help

For more info on installation, check out our guide.

Getting Started

  1. Install the example python dependencies:
pip install -r raw.githubusercontent.com/dora-rs/dora/v0.3.2/examples/python-operator-dataflow/requirements.txt
  1. Get some example operators:
wget raw.githubusercontent.com/dora-rs/dora/v0.3.2/examples/python-operator-dataflow/webcam.py
wget raw.githubusercontent.com/dora-rs/dora/v0.3.2/examples/python-operator-dataflow/plot.py
wget raw.githubusercontent.com/dora-rs/dora/v0.3.2/examples/python-operator-dataflow/utils.py
wget raw.githubusercontent.com/dora-rs/dora/v0.3.2/examples/python-operator-dataflow/object_detection.py
wget raw.githubusercontent.com/dora-rs/dora/v0.3.2/examples/python-operator-dataflow/dataflow.yml
  1. Start the dataflow
dora up
dora start dataflow.yml --attach --hot-reload

Make sure to have a webcam

To stop your dataflow, you can use ctrl+c

To go further, you can add a yolov8 operator, check out our getting started here: https://dora.carsmos.ai/docs/guides/getting-started/yolov8/

ROS2 Bridge

  • Compilation Free Message passing to ROS 2
  • Automatic conversion ROS 2 Message <-> Arrow Array
import random
import pyarrow as pa

# Configuration Boilerplate...
turtle_twist_writer = ...

## Arrow Based ROS2 Twist Message
## which does not requires ROS2 import
message = pa.array([{
            "linear": {
                "x": 1,
            },
            "angular": {
                "z": 1
            },
        }])

turtle_twist_writer.publish(message)

You might want to use ChatGPT to write the Arrow Formatting: https://chat.openai.com/share/4eec1c6d-dbd2-46dc-b6cd-310d2895ba15

Hardwares

Cool hardware that we think might be good fit to try out dora-rs 🙋 We are not sponsored by manufacturers:

Price Open Source Github type Dora Project
DJI Robomaster S1 550$ SDK https://github.com/dji-sdk/RoboMaster-SDK Rover https://huggingface.co/datasets/dora-rs/dora-robomaster
DJI Robomaster EP Core 950$ SDK https://github.com/dji-sdk/RoboMaster-SDK Rover, Arm
DJI Tello 100$ Drone
BitCraze Crazyflies 225$ Firmware, Lib, SDK https://github.com/bitcraze Drone
AlexanderKoch-Koch/low_cost_robot 250$ Everything https://github.com/AlexanderKoch-Koch/low_cost_robot Arm
xArm 1S 200$ Arm
Wavego 250$ Quadruplet
AINex 800$ Humanoid

For more: https://docs.google.com/spreadsheets/d/1YYeW2jfOIWDVgdEgqnMvltonHquQ7K8OZCrnJRELL6o/edit#gid=0

Documentation

The full documentation is available on our website

Discussions

Our main communication channels are:

Feel free to reach out on any topic, issues or ideas.

We also have a contributing guide.

Support Matrix

dora-rs Hoped for
Tier 1 Support Python, Rust C, C++, ROS 2
Tier 2 Support C, C++, ROS2
Hot-reloading Python Rust (https://github.com/orgs/dora-rs/discussions/360)
Message Format Arrow Native
Local Communication Shared Memory Custom Middleware, zero-copy GPU IPC, intra-process channel communication
Remote Communication TCP (See: dora-rs#459) Custom Middleware, Zenoh
Metrics, Tracing, and Logging Opentelemetry Native logging libraries into Opentelemetry
Data archives Parquet (dora-record)
Visualization and annotation OpenCV rerun.io
Supported Platforms (x86) Windows, macOS, Linux
Supported Platforms (ARM) macOS, Linux
Configuration YAML

License

This project is licensed under Apache-2.0. Check out NOTICE.md for more information.

About

low latency, composable, and distributed dataflow for AI and robotic application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 96.4%
  • Python 2.0%
  • C 1.3%
  • Other 0.3%