diff --git a/zenoh-bridge-ros2dds/src/main.rs b/zenoh-bridge-ros2dds/src/main.rs index 4cb2e32..7be9326 100644 --- a/zenoh-bridge-ros2dds/src/main.rs +++ b/zenoh-bridge-ros2dds/src/main.rs @@ -16,7 +16,7 @@ use bridge_args::BridgeArgs; use clap::Parser; use ros_args::RosArgs; use std::time::{Duration, SystemTime}; -use zenoh::config::Config; +use zenoh::config::{Config, ModeDependentValue}; mod bridge_args; mod ros_args; @@ -49,6 +49,12 @@ fn parse_args() -> (Option, Config) { let ros_args = RosArgs::parse_from(ros_args); ros_args.update_config(&mut config); + // Always add timestamps to publications (required for PublicationCache used in case of TRANSIENT_LOCAL topics) + config + .timestamping + .set_enabled(Some(ModeDependentValue::Unique(true))) + .unwrap(); + (watchdog_opt, config) }