[ROS2 Foxy] Implement FastRTPS discovery server. Don't found topic avaliable

asked 2021-01-05 02:58:35 -0500

Seviner gravatar image

I implement FastRTPS Discovery for foxy ros2 on ubuntu20

Follow instruction : link text

I choose way to config discovery server by xml file I created setup follow instruction : link text

My Server Profile

<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">

  <participant profile_name="participant_profile_ros2" is_default_profile="true">
    <rtps> 
      <prefix>4D.49.47.69.30.4c.5f.42.41.52.4f.55</prefix>

      <builtin>

        <discovery_config>
          <!-- <discoveryProtocol>CLIENT</discoveryProtocol> -->
          <discoveryProtocol>SERVER</discoveryProtocol>
          <!-- <discoveryProtocol>BACKUP</discoveryProtocol> -->
        </discovery_config>

        <metatrafficUnicastLocatorList>
          <locator>                                                                                                                                                                                        
              <udpv4>
                  <address>10.1.100.1</address>
                  <port>64863</port>
              </udpv4>
          </locator>
        </metatrafficUnicastLocatorList>

      </builtin>
    </rtps>
  </participant>

  <publisher profile_name="ros2_publisher_profile" is_default_profile="true">
      <qos>
          <publishMode>
              <kind>SYNCHRONOUS</kind>
          </publishMode>
      </qos>
      <historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>
  </publisher>

  <subscriber profile_name="ros2_subscription_profile" is_default_profile="true">
      <historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>
  </subscriber>

</profiles>

My Client Profile

<?xml version="1.0" encoding="UTF-8" ?>                                                                                                                                                                    
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">

  <participant profile_name="participant_profile_ros2" is_default_profile="true">
  <rtps>

    <builtin>
      <discovery_config>

        <discoveryProtocol>CLIENT</discoveryProtocol>

        <discoveryServersList>
          <RemoteServer prefix="4D.49.47.69.30.4c.5f.42.41.52.4f.55">
            <metatrafficUnicastLocatorList>
              <locator>
                <udpv4>
                  <address>10.1.100.1</address>
                  <port>64863</port>
                </udpv4>
              </locator>
            </metatrafficUnicastLocatorList>
          </RemoteServer>
        </discoveryServersList>  

      </discovery_config>
    </builtin>
  </rtps>
  </participant>

  <publisher profile_name="ros2_publisher_profile" is_default_profile="true">
  <qos>
    <publishMode>
    <kind>SYNCHRONOUS</kind>
    </publishMode>
  </qos>
    <historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>
  </publisher>

  <subscriber profile_name="ros2_subscription_profile" is_default_profile="true">
    <historyMemoryPolicy>DYNAMIC</historyMemoryPolicy>
  </subscriber>

</profiles>

I have 2 computers connected by VPN.

First computer have ip-address 10.1.100.1 run server xml profild

Second computer have ip-address 10.1.100.2 run clinet by use node demo_node_cpp listen and talker

listen and talker can communication together but I can't see topic by

ROS2 command

ros2 topic list
ros2 topic echo /chatter
ros2 bag record -a

ROS2 code

import rclpy
from rclpy.node import Node
rclpy.init()
node = Node("topic_list")
node.get_topic_names_and_types()

Main my problems are can't see topic available and can't use ros2 bag record -a.

How can i solve problem on it by constrain I want to use discovery server because it can use by set only server ip-address.

edit retag flag offensive close merge delete

Comments

I followed the following tutorial: https://index.ros.org/doc/ros2/Tutori... and I'm seeing the same problem...

Mbuijs gravatar image Mbuijs  ( 2021-01-07 14:16:56 -0500 )edit

I ever try that tutorial too. That tutorial tell rqt_graph can verify node and structure but I can't use them to verify. I see some node not all structure...

Seviner gravatar image Seviner  ( 2021-01-07 22:11:53 -0500 )edit

I have reported this as an issue on the rmw_fastrtps github project: https://github.com/ros2/rmw_fastrtps/....

Mbuijs gravatar image Mbuijs  ( 2021-01-08 05:36:43 -0500 )edit