Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump zenoh version #97

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
rustup component add rustfmt clippy

- name: Code format check
run: cargo fmt --check
run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: local
hooks:
- id: fmt
name: fmt
entry: cargo fmt -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"
language: system
types: [rust]
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion zenoh-bridge-ros1/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
use std::str::FromStr;

use async_std::channel::unbounded;
use clap::{App, Arg};
use std::str::FromStr;
use zenoh::{
config::{Config, ZenohId},
internal::{plugins::PluginsManager, runtime::RuntimeBuilder},
Expand Down
1 change: 0 additions & 1 deletion zenoh-plugin-ros1/examples/ros1_standalone_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
//

use async_std::channel::unbounded;

use zenoh_plugin_ros1::ros_to_zenoh_bridge::environment::Environment;

#[async_std::main]
Expand Down
2 changes: 1 addition & 1 deletion zenoh-plugin-ros1/examples/ros1_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async fn main() {
print!("Creating Zenoh Publisher...");
let zenoh_publisher = zenoh_session
.declare_publisher("some/ros/topic")
.congestion_control(zenoh::publisher::CongestionControl::Block)
.congestion_control(zenoh::qos::CongestionControl::Block)
.await
.unwrap();
println!(" OK!");
Expand Down
7 changes: 4 additions & 3 deletions zenoh-plugin-ros1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
//
#![recursion_limit = "1024"]

use ros_to_zenoh_bridge::environment::Environment;
use ros_to_zenoh_bridge::ros1_master_ctrl::Ros1MasterCtrl;
use ros_to_zenoh_bridge::Ros1ToZenohBridge;
use std::time::Duration;

use ros_to_zenoh_bridge::{
environment::Environment, ros1_master_ctrl::Ros1MasterCtrl, Ros1ToZenohBridge,
};
use zenoh::{
internal::{
plugins::{RunningPlugin, RunningPluginTrait, ZenohPlugin},
Expand Down
9 changes: 4 additions & 5 deletions zenoh-plugin-ros1/src/ros_to_zenoh_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
// ZettaScale Zenoh Team, <[email protected]>
//

use async_std::task::JoinHandle;

use tracing::error;
use zenoh::{self, core::Result as ZResult, Session};

use std::sync::{
atomic::{AtomicBool, Ordering::Relaxed},
Arc,
};

use async_std::task::JoinHandle;
use tracing::error;
use zenoh::{self, Result as ZResult, Session};

use self::{environment::Environment, ros1_to_zenoh_bridge_impl::work_cycle};

#[cfg(feature = "test")]
Expand Down
9 changes: 4 additions & 5 deletions zenoh-plugin-ros1/src/ros_to_zenoh_bridge/abstract_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

use std::sync::Arc;

use tracing::{debug, error, info};

use rosrust::RawMessageDescription;
use zenoh::{core::Result as ZResult, internal::bail, key_expr::keyexpr, prelude::*};
use tracing::{debug, error, info};
use zenoh::{internal::bail, key_expr::keyexpr, prelude::*, Result as ZResult};

use super::{
bridge_type::BridgeType, ros1_client, topic_descriptor::TopicDescriptor,
Expand Down Expand Up @@ -140,7 +139,7 @@ impl Ros1ToZenohClient {
}

struct Ros1ToZenohService {
_queryable: zenoh::queryable::Queryable<'static, ()>,
_queryable: zenoh::query::Queryable<'static, ()>,
}
impl Ros1ToZenohService {
async fn new<'b>(
Expand Down Expand Up @@ -297,7 +296,7 @@ impl Ros1ToZenoh {
}

struct ZenohToRos1 {
_subscriber: zenoh::subscriber::Subscriber<'static, ()>,
_subscriber: zenoh::pubsub::Subscriber<'static, ()>,
}
impl ZenohToRos1 {
async fn new(
Expand Down
21 changes: 15 additions & 6 deletions zenoh-plugin-ros1/src/ros_to_zenoh_bridge/aloha_declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,23 @@
// ZettaScale Zenoh Team, <[email protected]>
//

use zenoh::{
core::Priority, internal::buffers::ZBuf, key_expr::OwnedKeyExpr, prelude::*,
publisher::CongestionControl, sample::Locality, subscriber::Reliability, Session,
use std::{
sync::{
atomic::{AtomicBool, AtomicUsize},
Arc,
},
time::Duration,
};

use std::sync::atomic::{AtomicBool, AtomicUsize};
use std::sync::Arc;
use std::time::Duration;
use zenoh::{
internal::buffers::ZBuf,
key_expr::OwnedKeyExpr,
prelude::*,
pubsub::Reliability,
qos::{CongestionControl, Priority},
sample::Locality,
Session,
};

pub struct AlohaDeclaration {
monitor_running: Arc<AtomicBool>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use async_std::sync::Mutex;
use flume::Receiver;
use futures::{join, Future, FutureExt};
use tracing::error;
use zenoh::{core::Result as ZResult, key_expr::OwnedKeyExpr, prelude::*, sample::Sample, Session};
use zenoh::{key_expr::OwnedKeyExpr, prelude::*, sample::Sample, Result as ZResult, Session};

struct AlohaResource {
activity: AtomicBool,
Expand Down Expand Up @@ -134,7 +134,7 @@ impl AlohaSubscription {
async fn listening_task<'a, F>(
task_running: Arc<AtomicBool>,
accumulating_resources: &Mutex<HashMap<OwnedKeyExpr, AlohaResource>>,
subscriber: &'a zenoh::subscriber::Subscriber<'a, Receiver<Sample>>,
subscriber: &'a zenoh::pubsub::Subscriber<'a, Receiver<Sample>>,
on_resource_declared: &F,
) where
F: Fn(zenoh::key_expr::KeyExpr) -> Box<dyn futures::Future<Output = ()> + Unpin + Send>
Expand Down
Loading
Loading