diff --git a/Cargo.lock b/Cargo.lock index 36b091a..6a9d599 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -138,9 +138,9 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.1.37" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" +checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8" dependencies = [ "shlex", ] @@ -851,7 +851,7 @@ dependencies = [ [[package]] name = "lebai-proto" -version = "3.2.1" +version = "3.2.2" dependencies = [ "jsonrpsee", "pbjson", @@ -866,7 +866,7 @@ dependencies = [ [[package]] name = "lebai_sdk" -version = "0.2.19" +version = "0.2.20" dependencies = [ "async-lock", "cmod", diff --git a/Cargo.toml b/Cargo.toml index c6a675b..44d5a9d 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.19" +version = "0.2.20" [workspace] members = [ diff --git a/proto/Cargo.toml b/proto/Cargo.toml index 2e4ef1a..c69f9ce 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.2.1" +version = "3.2.2" [dependencies] jsonrpsee = {version = "0.24", features = ["client-core", "macros"]} diff --git a/proto/src/lib.rs b/proto/src/lib.rs index 84b9663..a122e0b 100644 --- a/proto/src/lib.rs +++ b/proto/src/lib.rs @@ -1,9 +1,4 @@ -pub mod io; -pub mod kinematic; -pub mod led; -pub mod modbus; -pub mod posture; -pub mod task; +pub mod serde; pub mod google { pub mod protobuf { diff --git a/proto/src/io.rs b/proto/src/serde/io.rs similarity index 100% rename from proto/src/io.rs rename to proto/src/serde/io.rs diff --git a/proto/src/kinematic.rs b/proto/src/serde/kinematic.rs similarity index 96% rename from proto/src/kinematic.rs rename to proto/src/serde/kinematic.rs index f8500cd..e0bbad0 100644 --- a/proto/src/kinematic.rs +++ b/proto/src/serde/kinematic.rs @@ -1,5 +1,5 @@ use crate::lebai::kinematic; -use crate::posture::{CartesianPose, JointPose}; +use crate::serde::posture::{CartesianPose, JointPose}; use serde::{Deserialize, Serialize}; #[derive(Deserialize, Serialize)] diff --git a/proto/src/led.rs b/proto/src/serde/led.rs similarity index 100% rename from proto/src/led.rs rename to proto/src/serde/led.rs diff --git a/proto/src/serde/mod.rs b/proto/src/serde/mod.rs new file mode 100644 index 0000000..1a913dd --- /dev/null +++ b/proto/src/serde/mod.rs @@ -0,0 +1,6 @@ +pub mod io; +pub mod kinematic; +pub mod led; +pub mod modbus; +pub mod posture; +pub mod task; diff --git a/proto/src/modbus.rs b/proto/src/serde/modbus.rs similarity index 100% rename from proto/src/modbus.rs rename to proto/src/serde/modbus.rs diff --git a/proto/src/posture.rs b/proto/src/serde/posture.rs similarity index 100% rename from proto/src/posture.rs rename to proto/src/serde/posture.rs diff --git a/proto/src/task.rs b/proto/src/serde/task.rs similarity index 100% rename from proto/src/task.rs rename to proto/src/serde/task.rs diff --git a/src/lib.rs b/src/lib.rs index 27d3472..b6348c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,13 +8,13 @@ mod runtime; pub mod lebai_sdk { use super::*; use cmod::Result; - use proto::kinematic::KinData; use proto::lebai::claw::Claw; use proto::lebai::dynamic::Payload; use proto::lebai::posture::Position; use proto::lebai::system::{EstopReason, PhyData, RobotState}; - use proto::led::LedStyle; - use proto::posture::{CartesianPose, JointPose, Pose}; + use proto::serde::kinematic::KinData; + use proto::serde::led::LedStyle; + use proto::serde::posture::{CartesianPose, JointPose, Pose}; use runtime::CompatExt as _; #[cmod::function] @@ -572,3 +572,5 @@ pub mod lebai_sdk { } } } + +pub use lebai_sdk::*; diff --git a/src/rpc/kinematic.rs b/src/rpc/kinematic.rs index 3913fd9..07469c8 100644 --- a/src/rpc/kinematic.rs +++ b/src/rpc/kinematic.rs @@ -1,10 +1,10 @@ use super::Robot; use cmod::Result; use proto::google::protobuf::Empty; -use proto::kinematic::KinData; use proto::lebai::db::LoadRequest; use proto::lebai::kinematic::*; -use proto::posture::CartesianPose; +use proto::serde::kinematic::KinData; +use proto::serde::posture::CartesianPose; impl Robot { pub(crate) async fn load_tcp(&self, name: String, dir: Option) -> Result { diff --git a/src/rpc/led.rs b/src/rpc/led.rs index effae0a..7e6503b 100644 --- a/src/rpc/led.rs +++ b/src/rpc/led.rs @@ -2,7 +2,7 @@ use super::Robot; use cmod::Result; use proto::lebai::db::LoadRequest; use proto::lebai::led::*; -use proto::led::LedStyle; +use proto::serde::led::LedStyle; impl Robot { pub(crate) async fn load_led_style(&self, name: String, dir: Option) -> Result { diff --git a/src/rpc/mod.rs b/src/rpc/mod.rs index 577f165..cb36b79 100644 --- a/src/rpc/mod.rs +++ b/src/rpc/mod.rs @@ -5,10 +5,10 @@ pub mod kinematic; pub mod led; pub mod modbus; pub mod motion; +pub mod motor; pub mod plugin; pub mod posture; pub mod serial; -pub mod motor; pub mod signal; pub mod storage; pub mod system; diff --git a/src/rpc/motion.rs b/src/rpc/motion.rs index 7e2c394..d30d955 100644 --- a/src/rpc/motion.rs +++ b/src/rpc/motion.rs @@ -3,7 +3,7 @@ use cmod::Result; use proto::google::protobuf::Empty; use proto::lebai::db::LoadRequest; use proto::lebai::motion::*; -use proto::posture::{CartesianPose, JointPose, Pose}; +use proto::serde::posture::{CartesianPose, JointPose, Pose}; impl Robot { pub(crate) async fn pause_move(&self) -> Result<()> { diff --git a/src/rpc/posture.rs b/src/rpc/posture.rs index db8984f..472117e 100644 --- a/src/rpc/posture.rs +++ b/src/rpc/posture.rs @@ -2,7 +2,7 @@ use super::Robot; use cmod::Result; use proto::lebai::db::*; use proto::lebai::posture::{self, *}; -use proto::posture::{CartesianPose, JointPose, Pose}; +use proto::serde::posture::{CartesianPose, JointPose, Pose}; impl Robot { pub async fn kinematics_forward(&self, p: Pose) -> Result { diff --git a/src/runtime.rs b/src/runtime.rs index 58e0075..1088c7e 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -3,7 +3,7 @@ use core::pin::Pin; use core::task::{Context, Poll}; use pin_project_lite::pin_project; -#[cfg(all(not(target_family = "wasm"), feature="module"))] +#[cfg(all(not(target_family = "wasm"), feature = "module"))] pub static RT: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| { tokio::runtime::Builder::new_multi_thread() .thread_name("lebai-sdk") @@ -54,7 +54,7 @@ impl Future for Compat { type Output = T::Output; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - #[cfg(all(not(target_family = "wasm"), feature="module"))] + #[cfg(all(not(target_family = "wasm"), feature = "module"))] let _guard = RT.enter(); self.project().inner.poll(cx) }