ROS Discovery Server Setup
Configure the ROS 2 Discovery Server
Start a Fast DDS discovery server on the host, configure the micro‑ROS agent to connect to it and verify discovery connectivity.
The Fast DDS discovery server centralizes participant discovery for distributed ROS 2 systems. Use this module to start the server, update the micro‑ROS agent configuration and verify that your robot and workstation can communicate through the discovery server.
fastdds discovery --server-id 0
Next, create or edit the file ~/ros2_ws/super_client_configuration_file_rcr.xml to configure the discovery server’s IP address. Replace 192.168.1.10 and 192.168.1.20 with the IPs of your server and robot respectively:
<dds>
<participants>
<participant name="FastDDS"
domainId="0"
type="dds">
<rtps>
<participantID>1</participantID>
<userTransports>
<metatrafficMulticastLocator address="192.168.1.10" port="7400"/>
<metatrafficUnicastLocator address="192.168.1.10" port="7410"/>
<initialPeersRange address="192.168.1.20" />
</userTransports>
</rtps>
</participant>
</participants>
</dds>
SERIAL_TEENSY_DEVICE=$(find /dev/serial/by-id/ -name "usb-Teensyduino*if00" | head -1)
echo $SERIAL_TEENSY_DEVICE
sudo docker run -it --rm \
-v /dev:/dev --privileged --net=host \
--env-file ./env.list \
--name agent microros/micro-ros-agent:kilted \
serial --dev ${SERIAL_TEENSY_DEVICE} -v4
Copy your updated configuration into the running container and commit it so it persists across restarts:
sudo docker cp ~/ros2_ws/super_client_configuration_file_rcr.xml agent:/uros_ws/
sudo docker commit agent microros/micro-ros-agent:kilted
To verify that the server is running and discoverable, check the Fast DDS process and ping between hosts:
ps aux | grep fastdds
ping 192.168.1.10