Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 116 additions & 102 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,109 +1,123 @@
name: Release

on:
workflow_dispatch:
workflow_dispatch:

permissions:
contents: read
contents: read

jobs:
build:
name: Build wheels (${{ matrix.platform.id }})
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
# manylinux_2_28 x86_64 (cp310-cp313)
- id: manylinux_2_28-x86_64
runner: ubuntu-22.04
target: x86_64-unknown-linux-gnu
manylinux: "2_28"
maturin_args: >-
--release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi
-i python3.10 -i python3.11 -i python3.12 -i python3.13

# manylinux_2_28 aarch64 (cp310-cp313)
- id: manylinux_2_28-aarch64
runner: ubuntu-22.04
target: aarch64-unknown-linux-gnu
manylinux: "2_28"
maturin_args: >-
--release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi
-i python3.10 -i python3.11 -i python3.12 -i python3.13

# macOS arm64 (cp310)
- id: macos-arm64-cp310
runner: macos-14
target: aarch64-apple-darwin
python: "3.10"
manylinux: ""
maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python

# macOS arm64 (cp311)
- id: macos-arm64-cp311
runner: macos-14
target: aarch64-apple-darwin
python: "3.11"
manylinux: ""
maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python

# macOS arm64 (cp312)
- id: macos-arm64-cp312
runner: macos-14
target: aarch64-apple-darwin
python: "3.12"
manylinux: ""
maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python

# macOS arm64 (cp313)
- id: macos-arm64-cp313
runner: macos-14
target: aarch64-apple-darwin
python: "3.13"
manylinux: ""
maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python

steps:
- uses: actions/checkout@v4

# Only needed for macOS builds (Linux manylinux builds run inside the container and
# actions/setup-python won't affect those).
- name: Setup Python (macOS only)
if: startsWith(matrix.platform.runner, 'macos')
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.platform.python }}

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
target: ${{ matrix.platform.target }}
manylinux: ${{ matrix.platform.manylinux }}
args: ${{ matrix.platform.maturin_args }}

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.platform.id }}
path: dist/*.whl

publish:
runs-on: ubuntu-22.04
needs: build
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist/

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Publish to PyPI
run: uv publish dist/*
build:
name: Build wheels (${{ matrix.platform.id }})
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
# manylinux_2_28 x86_64 (cp310-cp313)
- id: manylinux_2_28-x86_64
runner: ubuntu-22.04
target: x86_64-unknown-linux-gnu
manylinux: "2_28"
maturin_args: >-
--release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi
-i python3.10 -i python3.11 -i python3.12 -i python3.13

# manylinux_2_28 aarch64 (cp310-cp313)
- id: manylinux_2_28-aarch64
runner: ubuntu-22.04
target: aarch64-unknown-linux-gnu
manylinux: "2_28"
maturin_args: >-
--release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi
-i python3.10 -i python3.11 -i python3.12 -i python3.13

# macOS arm64 (cp310)
- id: macos-arm64-cp310
runner: macos-14
target: aarch64-apple-darwin
python: "3.10"
manylinux: ""
maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python

# macOS arm64 (cp311)
- id: macos-arm64-cp311
runner: macos-14
target: aarch64-apple-darwin
python: "3.11"
manylinux: ""
maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python

# macOS arm64 (cp312)
- id: macos-arm64-cp312
runner: macos-14
target: aarch64-apple-darwin
python: "3.12"
manylinux: ""
maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python

# macOS arm64 (cp313)
- id: macos-arm64-cp313
runner: macos-14
target: aarch64-apple-darwin
python: "3.13"
manylinux: ""
maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python

steps:
- uses: actions/checkout@v4

# Only needed for macOS builds (Linux manylinux builds run inside the container and
# actions/setup-python won't affect those).
- name: Setup Python (macOS only)
if: startsWith(matrix.platform.runner, 'macos')
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.platform.python }}

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
target: ${{ matrix.platform.target }}
manylinux: ${{ matrix.platform.manylinux }}
args: ${{ matrix.platform.maturin_args }}

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.platform.id }}
path: dist/*.whl

publish-crate:
runs-on: ubuntu-22.04
environment: release
needs: build
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.9.1
with:
pixi-version: v0.63.2
- name: Publish to crates.io
run: pixi run cargo publish -p booster_sdk
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

publish-pypi:
runs-on: ubuntu-22.04
needs: build
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist/

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Publish to PyPI
run: uv publish dist/*
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["booster_sdk", "booster_sdk_py"]
resolver = "2"

[workspace.package]
version = "0.1.0-alpha.6"
version = "0.1.0-alpha.7"
edition = "2024"
authors = ["Team whIRLwind"]
license = "MIT OR Apache-2.0"
Expand Down
37 changes: 12 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Booster Robotics Rust SDK
# Booster Robotics SDK

[![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/IntelligentRoboticsLab/booster_sdk#license)
[![Crates.io](https://img.shields.io/crates/v/booster_sdk.svg)](https://crates.io/crates/booster_sdk)
[![Downloads](https://img.shields.io/crates/d/booster_sdk.svg)](https://crates.io/crates/booster_sdk)
[![Docs](https://docs.rs/booster_sdk/badge.svg)](https://docs.rs/booster_sdk/latest/booster_sdk/)
[![PyPI](https://img.shields.io/pypi/v/booster_sdk.svg)](https://pypi.org/project/booster-sdk/)

A Rust SDK for controlling Booster robots based on [Booster Robotics C++ SDK](https://github.com/BoosterRobotics/booster_robotics_sdk).
This project is a Rust reimplementation of the original [Booster Robotics C++ SDK (`booster_robotics_sdk`)](https://github.com/BoosterRobotics/booster_robotics_sdk) for controlling Booster robots.

In addition to the Rust crate, this repository also provides Python bindings built on top of the Rust implementation.

## 🚧 Project Status

This library is currently in early development. The core architecture and types are defined, but none of it has been tested on
an actual robot yet. The DDS transport layer is implemented using RustDDS.
This library is currently in active development and has been tested on a real robot.

## API Examples

Expand Down Expand Up @@ -45,29 +46,19 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

## Experimental Python Bindings

Python bindings for the SDK are available using [PyO3](https://github.com/PyO3/pyo3). These bindings are very experimental!

### Requirements

- Python 3.10 or higher
- Rust toolchain (for building from source)

### Installation

The Python package can be built using pixi:
Python wheels are available on [PyPI](https://pypi.org/project/booster-sdk/):

```bash
pixi run py-build-wheel
pip install booster-sdk
```

This will create a wheel file in `booster_sdk_py/dist/` that can be installed with `pip install booster_sdk_py/dist/*.whl`.

### Python API Example

Note: Python bindings are intentionally minimal and expose a subset of the Rust API.
Note: Python bindings are experimental.

```python
from booster_sdk import BoosterClient, GripperCommand, Hand, RobotMode
from booster_sdk.client.booster import BoosterClient
from booster_sdk.types import GripperCommand, Hand, RobotMode

client = BoosterClient()

Expand All @@ -81,12 +72,8 @@ client.move_robot(0.5, 0.0, 0.0)
client.publish_gripper_command(GripperCommand.open(Hand.RIGHT))
```

The Python bindings currently cover basic mode changes, locomotion, and gripper control.

# DDS Setup

The Rust SDK communicates directly over DDS (RustDDS). Please refer to the [DDS Setup Guide](docs/dds_setup.md) for detailed instructions.
The Python bindings currently cover core control flows, including locomotion, gripper control, AI/LUI RPC calls, vision RPC calls, and X5 camera RPC calls.

## Contributing

This SDK is currently in early development. Contributions are welcome! Please open issues or pull requests for bug fixes, features, or documentation improvements.
This SDK is in active development. Contributions are welcome! Please open issues or pull requests for bug fixes, features, or documentation improvements.
2 changes: 1 addition & 1 deletion booster_sdk/examples/gripper_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! Run with: cargo run --example `gripper_control`
use booster_sdk::client::{BoosterClient, commands::GripperCommand};
use booster_sdk::client::loco::{BoosterClient, GripperCommand};
use booster_sdk::types::{Hand, RobotMode};

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion booster_sdk/examples/locomotion_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! Run with: cargo run --example `locomotion_control`

use booster_sdk::client::BoosterClient;
use booster_sdk::client::loco::BoosterClient;
use booster_sdk::types::RobotMode;
use tokio::time::Duration;

Expand Down
2 changes: 1 addition & 1 deletion booster_sdk/examples/look_around.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! Run with: cargo run --example `look_around`

use booster_sdk::client::BoosterClient;
use booster_sdk::client::loco::BoosterClient;
use tokio::time::Duration;

#[tokio::main]
Expand Down
Loading