diff --git a/Cargo.lock b/Cargo.lock index 545262b..d62d592 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -705,7 +705,7 @@ dependencies = [ [[package]] name = "lebai-proto" -version = "3.1.3" +version = "3.1.4" dependencies = [ "jsonrpsee", "pbjson", @@ -720,7 +720,7 @@ dependencies = [ [[package]] name = "lebai_sdk" -version = "0.2.9" +version = "0.2.10" dependencies = [ "async-lock", "cmod", diff --git a/Cargo.toml b/Cargo.toml index 630c972..08dd80f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" license-file = "LICENSE" name = "lebai_sdk" repository = "https://github.com/lebai-robotics/lebai-sdk.rs" -version = "0.2.9" +version = "0.2.10" [workspace] members = [ diff --git a/proto/Cargo.toml b/proto/Cargo.toml index 4b1e33b..a1830f7 100644 --- a/proto/Cargo.toml +++ b/proto/Cargo.toml @@ -6,7 +6,7 @@ keywords = ["protobuf"] license = "MIT" name = "lebai-proto" repository = "https://github.com/lebai-robotics/lebai-sdk.rs" -version = "3.1.3" +version = "3.1.4" [dependencies] jsonrpsee = {version = "0.21", features = ["client-core", "macros"]} diff --git a/src/rpc/claw.rs b/src/rpc/claw.rs index ff1f544..6524280 100644 --- a/src/rpc/claw.rs +++ b/src/rpc/claw.rs @@ -13,8 +13,8 @@ impl Robot { } pub(crate) async fn set_claw(&self, force: Option, amplitude: Option) -> Result<()> { let req = SetClawRequest { - force: force.map(|x| x.into()), - amplitude: amplitude.map(|x| x.into()), + force, + amplitude, }; let _ = self.c.set_claw(Some(req)).await.map_err(|e| e.to_string())?; Ok(()) diff --git a/src/rpc/dynamic.rs b/src/rpc/dynamic.rs index d4fa2f2..a7941d9 100644 --- a/src/rpc/dynamic.rs +++ b/src/rpc/dynamic.rs @@ -16,7 +16,7 @@ impl Robot { } pub(crate) async fn set_payload(&self, mass: Option, cog: Option) -> Result<()> { let req = SetPayloadRequest { - mass: mass.map(|x| x.into()), + mass, cog, }; let _ = self.c.set_payload(Some(req)).await.map_err(|e| e.to_string())?; diff --git a/src/rpc/motion.rs b/src/rpc/motion.rs index e3ce64b..4a7c221 100644 --- a/src/rpc/motion.rs +++ b/src/rpc/motion.rs @@ -101,7 +101,7 @@ impl Robot { for i in 0..p.0.len() { joints.push(JointMove { pose: p.0[i], - velocity: Some(v.get(i).copied().unwrap_or_default().into()), + velocity: v.get(i).copied(), acc: None, }) } @@ -114,8 +114,8 @@ impl Robot { for i in 0..p.0.len() { joints.push(JointMove { pose: p.0[i], - velocity: Some(v.get(i).copied().unwrap_or_default().into()), - acc: Some(a.get(i).copied().unwrap_or_default().into()), + velocity: v.get(i).copied(), + acc: a.get(i).copied(), }) } let req = MovePvatRequest { duration: t, joints };