Skip to content

Commit

Permalink
find_zero
Browse files Browse the repository at this point in the history
  • Loading branch information
rise0chen committed Aug 21, 2024
1 parent 6ba43e3 commit 0bb7a66
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 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 proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords = ["protobuf"]
license = "MIT"
name = "lebai-proto"
repository = "https://github.com/lebai-robotics/lebai-sdk.rs"
version = "3.1.5"
version = "3.1.6"

[dependencies]
jsonrpsee = {version = "0.21", features = ["client-core", "macros"]}
Expand Down
2 changes: 1 addition & 1 deletion proto/lebai-proto
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,12 @@ pub mod lebai_sdk {
self.0.estop().await
}

//MOTOR
#[classmethod]
pub async fn find_zero(&self) -> Result<()> {
self.0.find_zero().await
}

// KINEMATIC
#[classmethod]
#[cmod::tags(ret)]
Expand Down
1 change: 1 addition & 0 deletions src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub mod motion;
pub mod plugin;
pub mod posture;
pub mod serial;
pub mod motor;
pub mod signal;
pub mod storage;
pub mod system;
Expand Down
11 changes: 11 additions & 0 deletions src/rpc/motor.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use super::Robot;
use cmod::Result;
use proto::google::protobuf::Empty;
use proto::lebai::motor::*;

impl Robot {
pub(crate) async fn find_zero(&self) -> Result<()> {
let _ = self.c.find_zero(Some(Empty {})).await.map_err(|e| e.to_string())?;
Ok(())
}
}

0 comments on commit 0bb7a66

Please sign in to comment.