kachaka-api

Crates.iokachaka-api
lib.rskachaka-api
version0.1.0
created_at2025-01-12 14:55:55.158701+00
updated_at2025-01-12 14:55:55.158701+00
descriptionUnofficial Rust API client library for Kachaka Robot
homepage
repositoryhttps://github.com/hirtanak/kachaka-api-rust
max_upload_size
id1513307
size8,100,444
Takafumi Watanabe (dieu-detruit)

documentation

README

kachaka-api

Kachaka用の非公式Rust APIクライアントライブラリです。

機能

公式では、PythonおよびROS 2向けのクライアントが用意されていますが、このリポジトリではRust向けのクライアントライブラリを提供します。

インストール

Cargo.tomlに以下を追加してください:

[dependencies]
kachaka-api = "0.1.0"

使用例

基本的な使用方法

use kachaka_api::{KachakaApiClient, StartCommandOptions};

#[tokio::main]
async fn main() {
    let mut client = KachakaApiClient::connect("http://kachaka-020.local:26400")
        .await
        .unwrap();
    let response = client
        .speak(
            "こんにちは、カチャカです",
            StartCommandOptions::default()
                .title("タイトル")
                .cancel_all(true),
        )
        .await
        .unwrap();
    println!("{:?}", response);
}

その他の例

examplesディレクトリには以下のサンプルコードが含まれています:

  • watch_camera_image.rs: カメラ画像のストリーミング
  • watch_compressed_camera_image.rs: 圧縮されたカメラ画像のストリーミング
  • shelf_location_resolver.rs: 棚と目的地の名前解決
  • simple_speak.rs: コマンド実行のサンプル (発話とそれをキャンセルするサンプルになっています)
  • watch_update.rs: ロボットの状態監視
  • watch_error.rs: エラー監視
  • get_latest_info.rs: 最新情報の取得

ライセンス

MIT License

貢献

Issue、プルリクエストは大歓迎です。

⚠注意

  • まだすべてのAPIがサポートされているわけではありません。
Commit count: 0

cargo fmt