dora-rs/dora

GitHub: dora-rs/dora

面向AI机器人应用的低延迟数据流中间件,比ROS2快10倍以上,支持多语言和分布式部署。

Stars: 3002 | Forks: 318

#

网站 | Python API | Rust API | 指南 | Discord

Build and test rust docs PyPi Latest Release PyPi Latest Release
dora-rs%2Fdora | Trendshift
## 亮点 - 🚀 dora-rs 是一个用于运行实时多 AI 和多硬件应用程序的框架。 - 🦀 dora-rs 内核 100% 由 Rust 构成,与替代方案相比速度极快,例如比 `ros2` 快 ⚡️ [10-17 倍](https://github.com/dora-rs/dora-benchmark)。 - ❇️ 包含大量预打包节点,用于快速原型设计,简化了硬件、算法和 AI 模型的集成。

两个框架在 Python API 下的延迟基准测试,发送 40M 随机字节。

## 最新动态 🎉
2025 - \[08/25\] 引入了 `dora.builder`,这是一个用于命令式定义 `dora` dataflow 的新型 Pythonic API。 - \[07/25\] 在 hub 中添加了 Kornia rust 节点,用于 V4L / Gstreamer 摄像头和 Sobel 图像处理。 - \[06/25\] 增加了对基于 git 节点的支持,用于多摄像头深度估计的 dora-vggt,并添加 robot_descriptions_py 作为在 dora 中获取 urdfs 的默认方式。 - \[05/25\] 增加了对用于 fk 和 ik 的 dora-pytorch-kinematics、用于姿态估计的 dora-mediapipe、用于 rust 串口读写的 dora-rustypot、以及 rerun 中 points2d 和 points3d 可视化的支持。 - \[04/25\] 增加了对 dora-cotracker(用于跟踪帧上任意点)、最高支持 12bit 的 dora-rav1e AV1 编码和 dora-dav1d AV1 解码的支持。 - \[03/25\] 增加了对 dora async Python 的支持。 - \[03/25\] 增加了对 Microsoft Phi4、Microsoft Magma 的支持。 - \[03/25\] dora-rs 已被 [**GSoC 2025 🎉**](https://summerofcode.withgoogle.com/programs/2025/organizations/dora-rs-tb) 接收,并附有以下[**创意列表**](https://github.com/dora-rs/dora/wiki/GSoC_2025)。 - \[03/25\] 增加了对 Zenoh 分布式数据流的支持。 - \[03/25\] 增加了对 Meta SAM2、Kokoro(TTS)、使用 `llama.cpp` 改进的 Qwen2.5 性能的支持。 - \[02/25\] 增加了对 Qwen2.5(LLM)、Qwen2.5-VL(VLM)、outetts(TTS) 的支持
## 支持矩阵 | | dora-rs | | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **APIs** | Python >= 3.8 including sync ⭐✅
Rust ✅
C/C++ 🆗
ROS2 >= Foxy 🆗 | | **OS** | Linux: Arm 32 ⭐✅ Arm 64 ⭐✅ x86_64 ⭐✅
MacOS: Arm 64 ⭐✅
Windows: x86_64 🆗
WSL: x86_64 🆗
Android: 🛠️ (受阻于: https://github.com/elast0ny/shared_memory/issues/32)
IOS: 🛠️ | | **消息格式** | Arrow ✅
标准规范 🛠️ | | **本地通信** | 共享内存 ✅
[Cuda IPC](https://arrow.apache.org/docs/python/api/cuda.html) 📐 | | **远程通信** | [Zenoh](https://zenoh.io/) 📐 | | **RGB-D 流** | AV1 编码 (dora-rav1e), AV1 解码 (dora-dav1d)📐 | | **指标、追踪和日志** | Opentelemetry 📐 | | **配置** | YAML ✅ | | **包管理器** | [pip](https://pypi.org/): Python 节点 ✅ Rust 节点 ✅ C/C++ 节点 🛠️
[cargo](https://crates.io/): Rust 节点 ✅ | ## 节点中心 节点中心可在 [**`dora-rs/dora-hub`**](https://github.com/dora-rs/dora-hub/) 仓库中找到。 ## 示例 | 类型 | 标题 | 描述 | 最后提交 | | --------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | 视觉 | [YOLO](https://github.com/dora-rs/dora/blob/main/examples/python-dataflow) | 使用 YOLO 检测图像中的物体。 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fpython-dataflow&label=%20) | | ROS2 | [C++ ROS2 示例](https://github.com/dora-rs/dora/blob/main/examples/c++-ros2-dataflow) | 使用 C++ ROS2 的示例 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fc%2b%2b-ros2-dataflow&label=%20) | | ROS2 | [Rust ROS2 示例](https://github.com/dora-rs/dora/blob/main/examples/rust-ros2-dataflow) | 使用 Rust ROS2 的示例 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Frust-ros2-dataflow&label=%20) | | ROS2 | [Python ROS2 示例](https://github.com/dora-rs/dora/blob/main/examples/python-ros2-dataflow) | 使用 Python ROS2 的示例 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fpython-ros2-dataflow&label=%20) | | 基准测试 | [GPU 基准测试](https://github.com/dora-rs/dora/blob/main/examples/cuda-benchmark) | dora-rs 的 GPU 基准测试 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fcuda-benchmark&label=%20) | | 基准测试 | [CPU 基准测试](https://github.com/dora-rs/dora-benchmark/blob/main) | dora-rs 的 CPU 基准测试 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora-benchmark?path=dora-rs&label=%20) | | 教程 | [Rust 示例](https://github.com/dora-rs/dora/blob/main/examples/rust-dataflow) | 使用 Rust 的示例 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Frust-dataflow&label=%20) | | 教程 | [Python 示例](https://github.com/dora-rs/dora/blob/main/examples/python-dataflow) | 使用 Python 的示例 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fpython-dataflow&label=%20) | | 教程 | [CMake 示例](https://github.com/dora-rs/dora/blob/main/examples/cmake-dataflow) | 使用 CMake 的示例 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fcmake-dataflow&label=%20) | | 教程 | [C 示例](https://github.com/dora-rs/dora/blob/main/examples/c-dataflow) | C 节点示例 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fc-dataflow&label=%20) | | 教程 | [CUDA 示例](https://github.com/dora-rs/dora/blob/main/examples/cuda-benchmark) | 使用 CUDA Zero Copy 的示例 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fcuda-benchmark&label=%20) | | 教程 | [C++ 示例](https://github.com/dora-rs/dora/blob/main/examples/c++-dataflow) | C++ 节点示例 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fc%2b%2b-dataflow&label=%20) | | 教程 | [Python Dataflow Builder 示例](https://github.com/dora-rs/dora/blob/main/examples/python-dataflow-builder) | 使用新 Pythonic API 的示例。 | ![License](https://img.shields.io/github/last-commit/dora-rs/dora?path=examples%2Fpython-dataflow-builder&label=%20) | = ## 快速开始 ### 安装 ``` pip install dora-rs-cli ```
其他安装方式 使用我们的独立安装程序安装 dora,或从 [crates.io](https://crates.io/crates/dora-cli) 安装: ### 使用 cargo ``` cargo install dora-cli ``` ### 使用 macOS 和 Linux 的 Github release ``` curl --proto '=https' --tlsv1.2 -LsSf https://github.com/dora-rs/dora/releases/latest/download/dora-cli-installer.sh | sh ``` 安装特定版本: ``` curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/dora-rs/dora/main/install.sh | sh -s -- --tag v0.3.12 ``` ### 使用 Windows 的 Github release ``` powershell -ExecutionPolicy ByPass -c "irm https://github.com/dora-rs/dora/releases/latest/download/dora-cli-installer.ps1 | iex" ``` ### 从源码 ``` git clone https://github.com/dora-rs/dora.git cd dora cargo build --release -p dora-cli PATH=$PATH:$(pwd)/target/release ```
### 运行 - 运行 yolo python 示例: ``` ## 创建虚拟环境 uv venv --seed -p 3.11 ## 安装远程图的 nodes 依赖 dora build https://raw.githubusercontent.com/dora-rs/dora/refs/heads/main/examples/python-dataflow/dataflow.yml --uv ## 运行 yolo graph dora run dataflow.yml --uv ``` 要停止 dataflow,您可以使用 ctrl+c - 要了解正在发生什么,您可以使用以下命令查看 dataflow: ``` cat dataflow.yml ``` - 结果如下: ``` nodes: - id: camera build: pip install opencv-video-capture path: opencv-video-capture inputs: tick: dora/timer/millis/20 outputs: - image env: CAPTURE_PATH: 0 IMAGE_WIDTH: 640 IMAGE_HEIGHT: 480 - id: object-detection build: pip install dora-yolo path: dora-yolo inputs: image: camera/image outputs: - bbox - id: plot build: pip install dora-rerun path: dora-rerun inputs: image: camera/image boxes2d: object-detection/bbox ``` - 在上面的示例中,我们可以了解到摄像头正在向 rerun 查看器以及 yolo 模型发送图像,yolo 模型生成在 rerun 中可视化的边界框。 ### 文档 完整文档可在[我们的网站](https://dora-rs.ai/)上找到。 许多指南可在我们网站的[本部分](https://dora-rs.ai/docs/guides/)找到。 ## 什么是 Dora?Dora 提供哪些功能? **D**ataflow-**O**riented **R**obotic **A**rchitecture (`dora-rs`) 是一个让机器人应用程序的创建变得快速简单的框架。 `dora-rs` 实现了声明式 dataflow 范式,其中任务被拆分为作为独立进程隔离的节点。 dataflow 范式的优势在于创建了一个抽象层,使机器人应用程序模块化且易于配置。 ### TCP 通信和共享内存 节点之间的通信在同一台机器上通过共享内存处理,在分布式机器上通过 TCP 处理。我们的共享内存实现可跨进程跟踪消息,并在消息过时时将其丢弃。共享内存槽会被缓存以避免新的内存分配。 ### Arrow 消息格式 节点使用 Apache Arrow 数据格式进行通信。 [Apache Arrow](https://github.com/apache/arrow-rs) 是一种用于平面和分层数据的通用内存格式。Arrow 内存格式支持零拷贝读取,可实现闪电般的快速数据访问,且没有序列化开销。它定义了一个没有任何构建时或链接时依赖要求的 C 数据接口,这意味着 `dora-rs` 除了您喜爱语言的本地编译器外,**没有编译步骤**。 ### Opentelemetry dora-rs 使用 Opentelemetry 记录您的所有日志、指标和追踪。这意味着数据和遥测可以使用共享抽象进行链接。 [Opentelemetry](https://opentelemetry.io/) 是一个开源的可观测性标准,使得 dora-rs 遥测数据可被大多数后端(如 elasticsearch、prometheus、Datadog 等)收集。 Opentelemetry 独立于语言,与后端无关,并且可以轻松收集分布式数据,非常适合 dora-rs 应用程序。 ### ROS2 桥接 **注意**:此功能标记为不稳定。 - 无需编译即可向 ROS 2 传递消息 - 自动转换 ROS 2 消息 <-> Arrow 数组 ``` import pyarrow as pa # 配置 Boilerplate... turtle_twist_writer = ... ## 基于 Arrow 的 ROS2 Twist Message ## 不需要 ROS2 import message = pa.array([{ "linear": { "x": 1, }, "angular": { "z": 1 }, }]) turtle_twist_writer.publish(message) ``` ## 讨论 我们的主要沟通渠道是: - [我们的 Discord 服务器](https://discord.gg/6eMGGutkfE) - [我们的 Github 项目讨论区](https://github.com/orgs/dora-rs/discussions) 欢迎就任何主题、问题或想法联系我们。 我们还有[一份贡献指南](CONTRIBUTING.md)。 ## 许可证 本项目采用 Apache-2.0 许可。查看 [NOTICE.md](NOTICE.md) 了解更多信息。 ## 更多资源 📚 - [Zenoh 文档](https://zenoh.io/docs/getting-started/first-app/) - [DORA Zenoh 讨论 (GitHub Issue #512)](https://github.com/dora-rs/dora/issues/512) - [Dora Autoware 定位演示](https://github.com/dora-rs/dora-autoware-localization-demo) ``` ```
标签:Python, ROS2替代, Rust, UML, Vectored Exception Handling, 中间件, 人工智能, 代理服务器, 低延迟, 分布式系统, 可视化界面, 响应大小分析, 多模态, 实时系统, 开源框架, 性能优化, 持续集成, 数据流架构, 无后门, 有向图, 机器人开发框架, 机器人技术, 机器人操作系统, 检测绕过, 流处理, 流水线, 用户代理, 用户模式Hook绕过, 硬件抽象, 网络流量审计, 网络调试, 自动化, 自动驾驶, 计算机视觉, 边缘计算, 逆向工具, 通知系统