Skip to content

Latest commit

 

History

History
72 lines (55 loc) · 1.43 KB

File metadata and controls

72 lines (55 loc) · 1.43 KB

3 Simple Discovery

In this section, we will cover the simple discovery protocol and the use of domain IDs.

Note

Make sure to open new terminal windows with clean environments to avoid potential conflicting environment issues.

Turtlesim on Domains

Terminal 1: Turtlesim Node Terminal 2: Command Line Tools

Start the demo Turtlesim with a unique namespace:

ros2 run turtlesim turtlesim_node --ros-args -r __ns:=/<unique_namespace>

Make sure to keep the forward slash at the beginning of the namespace argument.

Restart the daemon, to reload the clean environment, and make sure you can see the Turtlesim nodes:
ros2 daemon stop
ros2 daemon start
ros2 node list
Get into pairs or a small group. Each group will have its own domain. Set your domain ID and restart the Turtlesim:
export ROS_DOMAIN_ID=<DOMAINID>

ros2 run turtlesim turtlesim_node --ros-args -r __ns:=/<unique_namespace>
Set the domain ID, restart the daemon, and make sure that only your team's nodes are on that domain.
export ROS_DOMAIN_ID=<DOMAINID>
ros2 daemon stop
ros2 daemon start
ros2 node list
Keep the node running Now you can drive your robot and/or your partner's robot:
ros2 run turtlesim turtle_teleop_key --ros-args -r __ns:=/<unique_namespace>