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
40 changes: 20 additions & 20 deletions Cargo.lock

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

7 changes: 1 addition & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
[workspace]
members = [
"booster_sdk",
"booster_sdk_py",
"examples/rust/locomotion",
"examples/rust/look_around",
]
members = ["booster_sdk", "booster_sdk_py", "examples/rust/*"]
resolver = "2"

[workspace.package]
Expand Down
40 changes: 4 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,18 @@ In addition to the Rust crate, this repository also provides Python bindings bui

This library is currently in active development and has been tested on a real robot.

## API Examples

### High-Level Locomotion Control

```rust
use booster_sdk::client::BoosterClient;
use booster_sdk::types::{RobotMode, Hand};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize and create client
let client = BoosterClient::new()?;

// Change to walking mode
client.change_mode(RobotMode::Walking).await?;

// Move forward
client.move_robot(0.5, 0.0, 0.0).await?;

// Wave hand
// Publish gripper commands if needed (DDS topic-based control)
client.publish_gripper_command(&booster_sdk::client::GripperCommand::open(Hand::Right))?;

// Lie down when done
client.lie_down().await?;

Ok(())
}
```

## Experimental Python Bindings
## Installation

Python wheels are available on [PyPI](https://pypi.org/project/booster-sdk/):

```bash
pip install booster-sdk
```

### Python API Example
## API Example

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

client = BoosterClient()

Expand All @@ -65,11 +35,9 @@ client.change_mode(RobotMode.WALKING)
# Move forward
client.move_robot(0.5, 0.0, 0.0)

# Open right gripper
client.publish_gripper_command(GripperCommand.open(Hand.RIGHT))
```

The Python bindings currently cover core control flows, including locomotion, gripper control, AI/LUI RPC calls, vision RPC calls, and X5 camera RPC calls.
The Python bindings cover core control flows, including locomotion, gripper control, AI/LUI RPC calls, vision RPC calls, and X5 camera RPC calls.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion booster_sdk/examples/gripper_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use tracing_subscriber::EnvFilter;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize logging
let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
let env_filter = EnvFilter::new("off,booster_sdk=debug");
tracing_subscriber::fmt().with_env_filter(env_filter).init();

tracing::info!("Starting gripper control example");
Expand Down
2 changes: 1 addition & 1 deletion examples/rust/locomotion/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "booster_example_locomotion"
name = "locomotion"
version = "0.1.0"
edition = "2024"

Expand Down
4 changes: 2 additions & 2 deletions examples/rust/locomotion/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! High-level locomotion control example.
//!
//! Run with:
//! `cargo run --manifest-path examples/rust/locomotion/Cargo.toml`
//! `cargo run -p locomotion`

use booster_sdk::client::loco::BoosterClient;
use booster_sdk::types::RobotMode;
Expand All @@ -10,7 +10,7 @@ use tracing_subscriber::EnvFilter;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
let env_filter = EnvFilter::new("off,booster_sdk=debug");
tracing_subscriber::fmt().with_env_filter(env_filter).init();

tracing::info!("Starting locomotion control example");
Expand Down
2 changes: 1 addition & 1 deletion examples/rust/look_around/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "booster_example_look_around"
name = "look_around"
version = "0.1.0"
edition = "2024"

Expand Down
4 changes: 2 additions & 2 deletions examples/rust/look_around/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//! Motion state subscription example.
//!
//! Run with:
//! `cargo run --manifest-path examples/rust/look_around/Cargo.toml`
//! `cargo run -p look_around`

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

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
let env_filter = EnvFilter::new("off,booster_sdk=debug");
tracing_subscriber::fmt().with_env_filter(env_filter).init();

tracing::info!("Starting motion state subscription example");
Expand Down