Fast-DDS: `ros2 topic info -v` prints wrong data [9293]

This bug report originated from https://github.com/ros2/ros2cli/issues/525.

ros2 topic info -v prints wrong Nodename, Namespace and QoS profile from ros2 daemon, NOTE: It seems that ros2 daemon with rmw_fastrtps_cpp does not set correct data after receiving data(w) from a node with rmw_cyclonedds_cpp because some message ids are optimized in CycloneDDS that not be sent (such as, PID_DURABILITY is a default value of VOLATILE, PID_PARTICIPANT_GUID is sent in data(p) before )

Expected Behavior

  • Node name is _ros2cli_{pid}, not _CREATED_BY_BARE_DDS_APP_
  • Namespace is /, not _CREATED_BY_BARE_DDS_APP_
  • Durability is RMW_QOS_POLICY_DURABILITY_VOLATILE (run ros2 with durability(volatile) )

such as,

Type: std_msgs/msg/String

Publisher count: 1

Node name: _ros2cli_3789
Node namespace: /
Topic type: std_msgs/msg/String
Endpoint type: PUBLISHER
GID: a2.71.10.01.63.3e.45.12.06.a7.78.19.00.00.08.03.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT
  Durability: RMW_QOS_POLICY_DURABILITY_VOLATILE
  Lifespan: 9223372036854775807 nanoseconds
  Deadline: 9223372036854775807 nanoseconds
  Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
  Liveliness lease duration: 9223372036854775807 nanoseconds

Subscription count: 0

Current Behavior

Type: std_msgs/msg/String

Publisher count: 1

Node name: _CREATED_BY_BARE_DDS_APP_
Node namespace: _CREATED_BY_BARE_DDS_APP_
Topic type: std_msgs/msg/String
Endpoint type: PUBLISHER
GID: a2.71.10.01.63.3e.45.12.06.a7.78.19.00.00.08.03.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT
  Durability: RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL
  Lifespan: 2147483651294967295 nanoseconds
  Deadline: 2147483651294967295 nanoseconds
  Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
  Liveliness lease duration: 2147483651294967295 nanoseconds

Subscription count: 0

Steps to Reproduce

  1. run on terminal A
$ export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
$ ros2 topic pub /talker1234 --qos-durability volatile  std_msgs/String "data: Hello World volatile" > /dev/null
  1. run on terminal B
$ ros2 daemon stop
$ export RMW_IMPLEMENTATION=rmw_fastrtps_cpp

$ ros2 topic info -v /talker1234

System information

  • Fast-RTPS version: 3dcd9ab13c5f7158a8ee460a55ef37d229d5ba08
  • OS: Ubuntu 20.04
  • Network interfaces: eth0 (192.168.0.61), lo (127.0.0.1)
  • ROS2: Foxy

Additional resources

  • Wireshark capture package data from CycloneDDS(vendor: 1.16) without PID_DURABILITY and PID_PARTICIPANT_GUID image

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (22 by maintainers)

Commits related to this issue

Most upvoted comments

@MiguelCompany

Thank you. After applying https://github.com/eProsima/Fast-DDS/pull/1384 on the latest branch (2.0.x with c1c29b2a5d4d40446603fd19a235012d56a47aa0), I confirmed that these issues are fixed.

@iuhilnehc-ynos We are not talking about the better approach, but the one mentioned in the standard. And what the standard says is that participant_key is sent using PID_PARTICIPANT_GUID

@fujitatomoya

but #1380 (comment) makes sense to me.

Besides that, we need to care this https://github.com/eProsima/Fast-DDS/issues/1380#issuecomment-690345951 .

WriterQos

  • constructor

    m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS

  • clean m_durability.clear(); // m_durability will be VOLATILE … m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS; // set TRANSIENT_LOCAL again

Before parsing the CDR data, the object is reset calling it’s clear method

I didn’t check that much before, so we need to continue to find which object and where sets the m_qos. Actually, I just quickly updated the following source code from

WriterQos::WriterQos()
{
    this->m_reliability.kind = RELIABLE_RELIABILITY_QOS;
    this->m_durability.kind = TRANSIENT_LOCAL_DURABILITY_QOS;
}

to

WriterQos::WriterQos()
{
    this->m_reliability.kind = RELIABLE_RELIABILITY_QOS;
    this->m_durability.kind = VOLATILE_DURABILITY_QOS;
}

And then it’s working.