From 411ec7aa3b32a9424cbeaa0d4e3ac1d08f75818f Mon Sep 17 00:00:00 2001 From: "ChenYing Kuo (CY)" Date: Mon, 4 Mar 2024 16:10:14 +0800 Subject: [PATCH] Support using zenoh config in zenoh-carla-bridge. (#19) Signed-off-by: ChenYing Kuo --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d016eba..ce89402 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,6 +49,10 @@ struct Opts { /// Select which kind of bridge you're using: zenoh-bridge-dds or zenoh-bridge-ros2dds. #[clap(short, long, value_enum)] mode: Option, + + /// Zenoh Config + #[clap(long, value_enum)] + zenoh_config: Option, } fn main() -> Result<()> { @@ -59,6 +63,7 @@ fn main() -> Result<()> { carla_port, zenoh_listen, mode, + zenoh_config, } = Opts::parse(); let mode = match mode { @@ -67,7 +72,10 @@ fn main() -> Result<()> { }; log::info!("Running Carla Autoware Zenoh bridge..."); - let mut config = Config::default(); + let mut config = match zenoh_config { + Some(conf_file) => Config::from_file(conf_file).unwrap(), + None => Config::default(), + }; config .listen .endpoints