Skip to content

Commit

Permalink
Fix matching subscriptions for remote only
Browse files Browse the repository at this point in the history
  • Loading branch information
JEnoch committed Oct 12, 2023
1 parent cbd7237 commit bfc76dd
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 31 deletions.
50 changes: 25 additions & 25 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-plugin-ros2dds/src/route_publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ impl RoutePublisher<'_> {
let publisher: Arc<Publisher<'static>> = context
.zsession
.declare_publisher(zenoh_key_expr.clone())
.allowed_destination(Locality::Remote)
.congestion_control(congestion_ctrl)
.res_async()
.await
Expand Down Expand Up @@ -508,7 +509,7 @@ fn deactivate_dds_reader(

fn do_route_message(sample: &DDSRawSample, publisher: &Arc<Publisher>, route_id: &str) {
if *LOG_PAYLOAD {
log::trace!("{route_id}: routing message - payload: {:02x?}", sample);
log::debug!("{route_id}: routing message - payload: {:02x?}", sample);
} else {
log::trace!("{route_id}: routing message - {} bytes", sample.len());
}
Expand Down
4 changes: 2 additions & 2 deletions zenoh-plugin-ros2dds/src/route_service_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fn do_route_request(
zenoh_req_buf.push_zslice(slice.subslice(20, slice.len()).unwrap());

if *LOG_PAYLOAD {
log::trace!("{route_id}: routing request {request_id:02x?} to Zenoh - payload: {zenoh_req_buf:02x?}");
log::debug!("{route_id}: routing request {request_id:02x?} to Zenoh - payload: {zenoh_req_buf:02x?}");
} else {
log::trace!(
"{route_id}: routing request {request_id:02x?} to Zenoh - {} bytes",
Expand Down Expand Up @@ -330,7 +330,7 @@ fn do_route_reply(route_id: String, reply: Reply, request_id: [u8; 16], rep_writ
dds_rep_buf.extend_from_slice(&zenoh_rep_buf[4..]);

if *LOG_PAYLOAD {
log::trace!("{route_id}: routing reply for {request_id:02x?} to Client - payload: {dds_rep_buf:02x?}");
log::debug!("{route_id}: routing reply for {request_id:02x?} to Client - payload: {dds_rep_buf:02x?}");
} else {
log::trace!(
"{route_id}: routing reply for {request_id:02x?} to Client - {} bytes",
Expand Down
4 changes: 2 additions & 2 deletions zenoh-plugin-ros2dds/src/route_service_srv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ fn do_route_request(
};

if *LOG_PAYLOAD {
log::trace!("{route_id}: routing request #{n} to Service - payload: {dds_req_buf:02x?}");
log::debug!("{route_id}: routing request #{n} to Service - payload: {dds_req_buf:02x?}");
} else {
log::trace!(
"{route_id}: routing request #{n} to Service - {} bytes",
Expand Down Expand Up @@ -448,7 +448,7 @@ fn do_route_reply(
zenoh_rep_buf.push_zslice(slice.subslice(20, slice.len()).unwrap());

if *LOG_PAYLOAD {
log::trace!("{route_id}: routing reply #{seq_num} to Client - payload: {zenoh_rep_buf:02x?}");
log::debug!("{route_id}: routing reply #{seq_num} to Client - payload: {zenoh_rep_buf:02x?}");
} else {
log::trace!(
"{route_id}: routing reply #{seq_num} to Client - {} bytes",
Expand Down
2 changes: 1 addition & 1 deletion zenoh-plugin-ros2dds/src/route_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl RouteSubscriber<'_> {

fn do_route_data(s: Sample, ros2_name: &str, data_writer: dds_entity_t) {
if *LOG_PAYLOAD {
log::trace!(
log::debug!(
"Route Subscriber (Zenoh:{} -> ROS:{}): routing data - payload: {:02x?}",
s.key_expr,
&ros2_name,
Expand Down

0 comments on commit bfc76dd

Please sign in to comment.