How to connect RosbotXL to discovery server

Hello,

My team and I have setup a discovery server for our ROS setup in our Lab. However, we are having the issue that even though we execute ‘export ROS_DISCOVERY_SERVER=“ip_address:port” on the rosbot_XL terminal as defined in the ros2 documentation, the snaps (rosbot, husarion-rplidar etc) do not connect to the discovery server. I am guessing this is because the snaps run an isolated environment with their own ros configuration independent of th host OS.

Could you let us know how we might be able to edit the ros configuration on the snaps so that they also connect to the discovery server. Thank you.

Hi @Kenneth_Egwu,

Thank you for your feedback.

1. FastDDS
Currently, you can use the following workaround: add export ROS_DISCOVERY_SERVER="ip:port" to /var/snap/rosbot/common/ros.env and run sudo snap restart rosbot.daemon. Note: this will be overwritten the next time you run snap set ros.*.

2. Zenoh
2nd option, you can use zenoh and edit the endpoint (shared router). Helpful commands:

# copy default profile to create your custom one
cp local-ros/rmw/zenoh/default.json5 local-ros/rmw/zenoh/lab.json5
cp local-ros/rmw/zenoh-router/default-router.json5 local-ros/rmw/zenoh-router/lab-router.json5

# point the session profile at the shared router — in lab.json5, set:
connect: { endpoints: ["tcp/<lab-router-ip>:7447"] }
# Leave mode: "peer" unless this node is itself meant to be the router.

# change transport
sudo snap set rosbot ros.transport=zenoh/lab
sudo rosbot.restart

I hope this solves your problem.