| Crates.io | seersdk-rs |
| lib.rs | seersdk-rs |
| version | 1.0.0 |
| created_at | 2026-01-07 00:26:30.344645+00 |
| updated_at | 2026-01-07 00:26:30.344645+00 |
| description | Rust SDK for RBK robot TCP communication |
| homepage | |
| repository | https://github.com/paval-shlyk/seersdk-rs |
| max_upload_size | |
| id | 2027207 |
| size | 255,768 |
A Rust client library for communicating with RBK robots via TCP.
Add this to your Cargo.toml:
[dependencies]
seersdk-rs = "1.0.0"
use seersdk_rs::{RbkClient, BatteryStatusRequest};
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a client connection to the robot
let client = RbkClient::new("192.168.8.114");
// Create a typed request
let request = BatteryStatusRequest::new();
// Send the request and get a typed response
let response = client.request(request, Duration::from_secs(10)).await?;
println!("Response: {:?}", response);
Ok(())
}
For development and testing without physical hardware:
cargo run --example mock_robot_server
cargo run --example tui_client -- localhost
Or connect programmatically:
let client = RbkClient::new("localhost");
// ... use the client as normal
The RBK protocol uses different ports for different API categories:
The SDK provides type-safe request DTOs for all RBK APIs. Each request type is generated using the impl_api_request! macro and implements the ToRequestBody and FromResponseBody traits.
The StateApi enum includes over 55 robot state query operations covering:
Examples:
CommonInfoRequest - Query robot information (API 1000)BatteryStatusRequest - Check battery status (API 1007)RobotPoseRequest - Query robot location (API 1004)Control operations including:
Examples:
StopExerciseRequest - Stop open loop motion (API 2000)RelocateRequest - Relocation (API 2002)SwitchMapRequest - Switch map (API 2022)Navigation and path planning operations:
Example:
MoveToTargetRequest - Path navigation (API 3051)Configuration management operations including:
Extensive peripheral control operations:
Examples:
LoadJackRequest - Jacking load (API 6070)UnloadJackRequest - Jacking unload (API 6071)The examples/ directory contains several demonstration programs:
Query battery status from a real robot:
cargo run --example battery_query
A standalone binary that emulates a complete RBK robot with mock navigation logic. Perfect for testing and development without physical hardware.
# Start the mock robot server
cargo run --example mock_robot_server
# The server listens on:
# - Port 19204: State APIs (battery, position, etc.)
# - Port 19205: Control APIs (stop, relocate, etc.)
# - Port 19206: Navigation APIs (move, pause, resume, etc.)
# - Port 19207: Config APIs (parameters, maps, etc.)
# - Port 19208: Kernel APIs (shutdown, reboot)
# - Port 19210: Peripheral APIs (jack, audio, I/O, etc.)
# - Port 8080: HTTP REST API for waypoint management
The mock server features:
The mock server initializes with three default waypoints:
| ID | X | Y | Description |
|---|---|---|---|
home |
0.0 | 0.0 | Home position (origin) |
station_a |
10.0 | 5.0 | Station A location |
station_b |
-5.0 | 10.0 | Station B location |
You can list, add, and delete waypoints using the TUI client commands (wp list, wp add, wp delete) or via the HTTP REST API.
Run the mock server in Docker for easy deployment:
Using Pre-built Image (from GitHub Container Registry):
# Pull and run the latest image
docker run -d \
--name mocked-robot-server \
-p 19204-19210:19204-19210 \
-p 8080:8080 \
ghcr.io/paval-shlyk/seersdk-rs/mocked-robot:latest
# Or with docker-compose (see docker/docker-compose.yml)
Building Locally:
# Build the Docker image
./docker/build.sh
# Run the container
./docker/run.sh
# Or use Docker Compose
docker-compose -f docker/docker-compose.yml up -d
The Docker image is automatically built and published to GitHub Container Registry on every push to master. Available for both linux/amd64 and linux/arm64 platforms.
See docker/README.md for detailed Docker documentation and .github/DOCKER_CI.md for CI/CD information.
An interactive Terminal User Interface for sending and receiving RBK messages. Uses the seersdk-rs crate to communicate with robots.
# Connect to mock server
cargo run --example tui_client -- localhost
# Or connect to a real robot
cargo run --example tui_client -- 192.168.8.114
Features:
battery / bat / 1 - Query battery statusposition / pos / 2 - Query robot positioninfo / 3 - Query robot informationnav <target> / 4 - Navigate to targetstop / 5 - Stop navigationpause / 6 - Pause navigationresume / 7 - Resume navigationjack load / 8 - Load jackjack unload / 9 - Unload jackwp list - List all waypointswp add <id> <x> <y> - Add waypointwp delete <id> - Delete waypointhelp - Show all available commandsclear - Clear message historyControls:
Esc to enter):
i - Enter editing modeq - Quit application? - Show helpc - Clear screenj/↓ - Scroll downk/↑ - Scroll upd/PgDn - Page downu/PgUp - Page upg/Home - Go to topG/End - Go to bottomEnter to sendEsc - Enter normal modeCtrl+j/Ctrl+k - Scroll while typingCtrl+c - Clear screenA simple test client that verifies the mock server is working correctly:
# Make sure the mock server is running first
cargo run --example test_mock_server
A visual demonstration showing various API calls in action:
# Make sure the mock server is running first
cargo run --example demo
# Or connect to a real robot
cargo run --example demo -- 192.168.8.114
This demo showcases:
The project includes both unit tests and integration tests. Integration tests automatically start the mock server if it's not already running!
# Run all tests (auto-starts mock server if needed)
cargo test
# Or manually manage the server
# Terminal 1:
cargo run --example mock_robot_server
# Terminal 2:
cargo test
Unit Tests:
cargo test --lib
Integration Tests:
cargo test --test integration_tests
The integration tests verify:
Integration tests now include a test fixture that:
Build the documentation locally:
cargo doc --open
All RBK API requests and responses use JSON format. The SDK automatically handles serialization and deserialization.
This project is licensed under MIT OR Apache-2.0.