#!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" export RMW_IMPLEMENTATION=rmw_zenoh_cpp export ZENOH_ROUTER_CHECK_ATTEMPTS=-1 export ZENOH_ROUTER_CONFIG_URI=${SCRIPT_DIR}/ROUTER_CONFIG.json5 export ZENOH_SESSION_CONFIG_URI=${SCRIPT_DIR}/SESSION_CONFIG.json5 export ROS_STATIC_PEERS="" # This can be called to setup which routers to connect to. # I.E. On my laptop I source this config. I want to connect to # a robot with IP address 192.168.1.100 # I can call `zenoh_router_ip 192.168.1.100` and then I will talk to its # router. zenoh_router_ip() { local endpoints=() for ip in "$@"; do endpoints+=("'tcp/$ip:7447'") done local IFS=, export ZENOH_CONFIG_OVERRIDE="connect/endpoints=[${endpoints[*]}];" }