Skip to content

Commit

Permalink
measure_manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
rise0chen committed Dec 31, 2024
1 parent add6a4c commit 6f80cea
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
license-file = "LICENSE"
name = "lebai_sdk"
repository = "https://github.com/lebai-robotics/lebai-sdk.rs"
version = "0.2.21"
version = "0.2.22"

[workspace]
members = [
Expand Down
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.2.3"
version = "3.2.4"

[dependencies]
jsonrpsee = {version = "0.24", features = ["client-core", "macros"]}
Expand Down
2 changes: 1 addition & 1 deletion proto/lebai-proto
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ mod lebai_sdk {

// Posture
#[classmethod]
#[cmod::tags(args(p))]
pub async fn measure_manipulation(&self, p: JointPose) -> Result<f64> {
self.0.measure_manipulation(p).await
}
#[classmethod]
#[cmod::tags(args(p), ret)]
pub async fn kinematics_forward(&self, p: Pose) -> Result<CartesianPose> {
self.0.kinematics_forward(p).await
Expand Down
4 changes: 4 additions & 0 deletions src/rpc/posture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ use proto::lebai::posture::{self, *};
use proto::serde::posture::{CartesianPose, JointPose, Pose};

impl Robot {
pub async fn measure_manipulation(&self, p: JointPose) -> Result<f64> {
let ret = self.c.measure_manipulation(Some(p.into())).await.map_err(|e| e.to_string())?;
Ok(ret.manipulation)
}
pub async fn kinematics_forward(&self, p: Pose) -> Result<CartesianPose> {
let req = PoseRequest { pose: Some(p.into()) };
let pose = self.c.get_forward_kin(Some(req)).await.map_err(|e| e.to_string())?;
Expand Down

0 comments on commit 6f80cea

Please sign in to comment.