Connecting to real robot

Connecting to a real FOSSBot

IRiM and Fossbot4AI logos

This page describes how to connect your workstation to a physical FOSSBot so that the ROS 2 tools you already use in simulation talk to the real robot instead. Other labs link here wherever they say “connect to the robot”. Follow the steps once, confirm you can see the robot’s topics, then return to the lab you came from.

A real FOSSBot runs its own ROS 2 nodes and exposes the same topics as the simulator (/cmd_vel, /odom, /scan, and so on). You do not launch a simulator. Instead, your workstation joins the robot’s network and ROS 2 discovers the robot automatically over DDS (the Data Distribution Service that ROS 2 uses for communication).

Connection details

Use the values your instructor provides:

Setting Value (filled in by instructor)
Wi-Fi network (SSID) <LAB_WIFI_SSID>
Wi-Fi password <LAB_WIFI_PASSWORD>
Your robot’s ROS_DOMAIN_ID <YOUR_ROBOT_DOMAIN_ID>
Robot name / number <YOUR_ROBOT_NAME>
Command topic (if different) /cmd_vel

Steps

  1. Connect your workstation to the lab Wi-Fi <LAB_WIFI_SSID> using <LAB_WIFI_PASSWORD>.

  2. Start the container the same way as in the simulation labs:

bash start_container.sh

Because the container runs with --network=host, it shares your workstation’s Wi-Fi connection. Do not launch the simulator; the robot is the source of the topics now.

  1. Select your robot with ROS_DOMAIN_ID. ROS 2 nodes have no central master; they discover each other automatically over the network. By default, every ROS 2 node on the same network is visible to every other one. In a room full of robots and laptops on the same Wi-Fi, that means your commands could drive a neighbouring group’s robot, and theirs could drive yours. The ROS_DOMAIN_ID environment variable, a small integer (0 to 232, default 0), partitions the network into independent groups: nodes only see other nodes that share the same id. Each group uses a different id so their commands stay on their own robot. Run this in every terminal you open for work with the robot:
export ROS_DOMAIN_ID=<YOUR_ROBOT_DOMAIN_ID>
ros2 daemon stop ; ros2 daemon start
  1. Confirm you can see the robot:
ros2 node list
ros2 topic list

You should see the robot’s nodes, and the same topic names as the simulator (/cmd_vel, /odom, /scan).

Warning: If the lists are empty, you are not talking to the robot. Re-check that you are on <LAB_WIFI_SSID>, that ROS_DOMAIN_ID is set to <YOUR_ROBOT_DOMAIN_ID> in this exact terminal, and that you restarted the daemon. Then try again.

Warning: A real robot moves. Before you send any command, clear the space around the robot, place it on the floor or a wide table away from edges, keep the speeds small, and know how to stop it (Ctrl+C on whatever is publishing, then publish a single zero-velocity command on the command topic).

Expected result: ros2 topic list shows the robot’s topics over the lab network. You can now run the robot steps of the lab you came from, using the same commands you used in simulation.