# rainbowrobotics/rby1-sdk architecture

> Architecture diagram of the GitHub repository rainbowrobotics/rby1-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rainbowrobotics/rby1-sdk
- Repository: https://github.com/rainbowrobotics/rby1-sdk

## Overview

rby1-sdk is a C++ and Python SDK for RB-Y1 robot control and development. The main workflow is to create and connect a robot client, build and send commands, then consume state, feedback, or streamed logs. The SDK also exposes robot kinematics/dynamics and math utilities, device power and system operations, and UPC leader-arm control. The tree and excerpts establish the client, command, and dynamics components; several API and Python-binding details are known from the README and SOURCE INDEX, so those links are shown only where documented or marked unverified.

Main entry points: [`src/robot.cpp`](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot.cpp) (Robot client), [`include/rby1-sdk/dynamics/robot.h`](https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/dynamics/robot.h) (Kinematics dynamics), [`src/upc/leader_arm.cpp`](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/upc/leader_arm.cpp) (UPC leader arm), [`src/robot_command_builder.cpp`](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot_command_builder.cpp) (Command builders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Robot client"]
  node_robot_client["Robot client<br/>[robot.cpp]"]
  node_robot_api["Robot API<br/>[robot.h]"]
  node_robot_service["Robot services"]
  node_robot_state["Robot state<br/>[robot_state.cpp]"]
  node_robot_info["Robot info<br/>[robot_info.cpp]"]
  node_power_system["Power and system ops"]
  node_streaming["State and log streams<br/>[robot.cpp]"]
end

subgraph group_commands["Command execution"]
  node_command_builder["Command builders"]
  node_command_api["Command interfaces"]
  node_feedback["Command feedback"]
  node_command_proto["Command schemas"]
end

subgraph group_model["Robot modeling"]
  node_dynamics_robot["Kinematics dynamics<br/>[robot.h]"]
  node_dynamics_state["Dynamics state<br/>[state.h]"]
  node_model_config["Robot models<br/>[model.h]"]
  node_math["Math and optimization<br/>[optimal_control.h]"]
  node_se3["SE3 math<br/>[se3.cpp]"]
end

subgraph group_devices["Devices and control"]
  node_upc_arm["UPC leader arm<br/>[leader_arm.cpp]"]
  node_dynamixel["Dynamixel bus<br/>[dynamixel_bus.cpp]"]
  node_event_loop["Event loop<br/>[event_loop.h]"]
end

subgraph group_python["Python API"]
  node_python_bindings["Python bindings<br/>[robot.cpp]"]
  node_python_package["Python package<br/>[__init__.py]"]
end

node_developer(("SDK user"))
node_robot_endpoint(("RB-Y1 robot"))

node_developer -->|"uses"| node_robot_api
node_robot_api -->|"delegates to"| node_robot_client
node_robot_client -->|"connects by gRPC"| node_robot_endpoint
node_robot_client -.->|"calls services"| node_robot_service
node_developer -->|"configures"| node_command_api
node_command_api -->|"builds"| node_command_builder
node_robot_client -.->|"sends commands"| node_command_builder
node_command_builder -.->|"encodes"| node_command_proto
node_robot_client -->|"returns feedback"| node_feedback
node_robot_client -.->|"provides state"| node_robot_state
node_robot_client -.->|"provides info"| node_robot_info
node_robot_client -->|"starts streams"| node_streaming
node_robot_client -.->|"exposes operations"| node_power_system
node_model_config -->|"creates model"| node_dynamics_robot
node_dynamics_robot -->|"computes state"| node_dynamics_state
node_dynamics_robot -->|"uses transforms"| node_se3
node_math -->|"uses model"| node_dynamics_robot
node_developer -->|"imports"| node_python_package
node_python_package -.->|"exposes bindings"| node_python_bindings
node_developer -.->|"controls arm"| node_upc_arm
node_upc_arm -->|"uses bus"| node_dynamixel
node_upc_arm -.->|"schedules control"| node_event_loop

click node_robot_client "https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot.cpp"
click node_robot_api "https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/robot.h"
click node_robot_service "https://github.com/rainbowrobotics/rby1-sdk/tree/main/protos/rb/api"
click node_robot_state "https://github.com/rainbowrobotics/rby1-sdk/blob/main/python/robot_state.cpp"
click node_robot_info "https://github.com/rainbowrobotics/rby1-sdk/blob/main/python/robot_info.cpp"
click node_command_builder "https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot_command_builder.cpp"
click node_command_api "https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/robot_command_builder.h"
click node_feedback "https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot_command_feedback.cpp"
click node_command_proto "https://github.com/rainbowrobotics/rby1-sdk/blob/main/protos/rb/api/robot_command.proto"
click node_dynamics_robot "https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/dynamics/robot.h"
click node_dynamics_state "https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/dynamics/state.h"
click node_model_config "https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/model.h"
click node_math "https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/math/optimal_control.h"
click node_se3 "https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/math/se3.cpp"
click node_power_system "https://github.com/rainbowrobotics/rby1-sdk/tree/main/protos/rb/api"
click node_streaming "https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot.cpp"
click node_upc_arm "https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/upc/leader_arm.cpp"
click node_dynamixel "https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/base/dynamixel_bus.cpp"
click node_event_loop "https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/base/event_loop.h"
click node_python_bindings "https://github.com/rainbowrobotics/rby1-sdk/blob/main/python/robot.cpp"
click node_python_package "https://github.com/rainbowrobotics/rby1-sdk/blob/main/python/rby1_sdk/__init__.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_robot_client,node_robot_api,node_robot_service,node_robot_state,node_robot_info,node_power_system,node_streaming,node_developer toneBlue
class node_command_builder,node_command_api,node_feedback,node_command_proto toneAmber
class node_dynamics_robot,node_dynamics_state,node_model_config,node_math,node_se3 toneMint
class node_upc_arm,node_dynamixel,node_event_loop toneRose
class node_python_bindings,node_python_package,node_robot_endpoint toneIndigo
```

## Components

### Robot client

- [Robot client](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot.cpp): `src/robot.cpp`
- [Robot API](https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/robot.h): `include/rby1-sdk/robot.h`
- [Robot services](https://github.com/rainbowrobotics/rby1-sdk/tree/main/protos/rb/api): `protos/rb/api`
- [Robot state](https://github.com/rainbowrobotics/rby1-sdk/blob/main/python/robot_state.cpp): `python/robot_state.cpp`
- [Robot info](https://github.com/rainbowrobotics/rby1-sdk/blob/main/python/robot_info.cpp): `python/robot_info.cpp`
- [Power and system ops](https://github.com/rainbowrobotics/rby1-sdk/tree/main/protos/rb/api): `protos/rb/api`
- [State and log streams](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot.cpp): `src/robot.cpp`

### Command execution

- [Command builders](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot_command_builder.cpp): `src/robot_command_builder.cpp`
- [Command interfaces](https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/robot_command_builder.h): `include/rby1-sdk/robot_command_builder.h`
- [Command feedback](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/robot_command_feedback.cpp): `src/robot_command_feedback.cpp`
- [Command schemas](https://github.com/rainbowrobotics/rby1-sdk/blob/main/protos/rb/api/robot_command.proto): `protos/rb/api/robot_command.proto`

### Robot modeling

- [Kinematics dynamics](https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/dynamics/robot.h): `include/rby1-sdk/dynamics/robot.h`
- [Dynamics state](https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/dynamics/state.h): `include/rby1-sdk/dynamics/state.h`
- [Robot models](https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/model.h): `include/rby1-sdk/model.h`
- [Math and optimization](https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/math/optimal_control.h): `include/rby1-sdk/math/optimal_control.h`
- [SE3 math](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/math/se3.cpp): `src/math/se3.cpp`

### Devices and control

- [UPC leader arm](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/upc/leader_arm.cpp): `src/upc/leader_arm.cpp`
- [Dynamixel bus](https://github.com/rainbowrobotics/rby1-sdk/blob/main/src/base/dynamixel_bus.cpp): `src/base/dynamixel_bus.cpp`
- [Event loop](https://github.com/rainbowrobotics/rby1-sdk/blob/main/include/rby1-sdk/base/event_loop.h): `include/rby1-sdk/base/event_loop.h`

### Python API

- [Python bindings](https://github.com/rainbowrobotics/rby1-sdk/blob/main/python/robot.cpp): `python/robot.cpp`
- [Python package](https://github.com/rainbowrobotics/rby1-sdk/blob/main/python/rby1_sdk/__init__.py): `python/rby1_sdk/__init__.py`

### Other components

- **SDK user**
- **RB-Y1 robot**

## Connections

- SDK user → Robot API: uses (evidence: `README.md`)
- Robot API → Robot client: delegates to (evidence: `src/robot.cpp`)
- Robot client → RB-Y1 robot: connects by gRPC (evidence: `src/robot.cpp`)
- Robot client → Robot services: calls services
- SDK user → Command interfaces: configures (evidence: `include/rby1-sdk/robot_command_builder.h`)
- Command interfaces → Command builders: builds (evidence: `src/robot_command_builder.cpp`)
- Robot client → Command builders: sends commands
- Command builders → Command schemas: encodes
- Robot client → Command feedback: returns feedback (evidence: `src/robot.cpp`)
- Robot client → Robot state: provides state
- Robot client → Robot info: provides info
- Robot client → State and log streams: starts streams (evidence: `src/robot.cpp`)
- Robot client → Power and system ops: exposes operations
- Robot models → Kinematics dynamics: creates model (evidence: `include/rby1-sdk/model.h`)
- Kinematics dynamics → Dynamics state: computes state (evidence: `include/rby1-sdk/dynamics/robot.h`)
- Kinematics dynamics → SE3 math: uses transforms (evidence: `include/rby1-sdk/dynamics/robot.h`)
- Math and optimization → Kinematics dynamics: uses model (evidence: `include/rby1-sdk/math/optimal_control.h`)
- SDK user → Python package: imports (evidence: `README.md`)
- Python package → Python bindings: exposes bindings
- SDK user → UPC leader arm: controls arm
- UPC leader arm → Dynamixel bus: uses bus
- UPC leader arm → Event loop: schedules control
