Skip to content

ROS2 Discovery Service Startup Tutorial

ROS2 Discovery Service starts with SDK

1. Preparation

Prepare the configuration file: super_client_configuration_file.xml Modify the value of the <address> tag as follows:

2. Comment out old service discovery configuration (if any)

Find the following environment variables in the robot's .bashrc that runs the SDK and comment them out:

#export FASTRTPS_DEFAULT_PROFILES_FILE=...

#echo export RMW_FASTRTPS_USE_QOS_FROM_XML=1

#export ROS_DOMAIN_ID=...

#export LOCAL_HOST_ONLY=...
Restart the terminal or re-establish SSH connection

3. Run SDK package

  1. Create a new terminal on the robot.
  2. Copy the prepared super_client_configuration_file.xml configuration file to a custom path. On the robot running the SDK, it is recommended to copy it to $HOME.
  3. Configure the discovery service client file environment variable (on the robot), add it to ~/.bashrc and source
    export FASTRTPS_DEFAULT_PROFILES_FILE=<custom configuration storage path>/super_client_configuration_file.xml
    
  4. Execute the SDK startup command: Note: The body package does not include the discovery service.
    ./robot_startup.sh boot ../session.d/***
    

4. Configure discovery service client for other multi-machine communication devices

To connect to the robot and communicate with the ROS2 SDK on a work computer, perform the following operations on the work computer: 1. Comment out the following environment variables in ~/.bashrc (if any)

#export FASTRTPS_DEFAULT_PROFILES_FILE=/home/nvidia/vr_workspace/install/startup_config/share/startup_config/script/prestart/fastrtps_profiles.xml

#echo export RMW_FASTRTPS_USE_QOS_FROM_XML=1

#export ROS_DOMAIN_ID=XX

#export LOCAL_HOST_ONLY=X
2. Copy the prepared super_client_configuration_file.xml configuration file to a custom path, then configure the discovery service client file environment variable, add it to ~/.bashrc and source
export FASTRTPS_DEFAULT_PROFILES_FILE=<custom configuration storage path>/super_client_configuration_file.xml
3. Test whether SDK topics can be viewed through ros2 topic list (may need to be executed twice to see). If topics cannot be seen, execute:
ros2 daemon stop
ros2 daemon start