design icon indicating copy to clipboard operation
design copied to clipboard

Forward slash in DDS topic name in example

Open miguelprada opened this issue 8 years ago • 6 comments
trafficstars

The Examples and Ideas for Communicating with Non-ROS Topics section in Topic and Service name mapping to DDS article presents an example where a DDS topic name containing a forward slash is discussed.

Although the article discusses an ambiguous specification of an "exact" topic name, I have the impresion that one of the two interpretations should not be legal in DDS. Specifically I'm referring to the mapping from rostopic+exact://camera_left/image to DDS topic camera_left/image and partition [].

Just bringing it up since it can lead to confusion. It probably makes little sense to combine rostopic+exact with a name containing forward slashes, right?

miguelprada avatar Apr 03 '17 10:04 miguelprada

@miguelprada thanks for pointing it out. I think the purpose of that last example was to bring up that issue with the concept of rostopic+exact://, which I thought would be addressed by the next line:

Considering the third case, it’s not clear if the / should be respected or if additional syntax is required to support partitions in the case of “exact” topic names.

Perhaps it should just be made clearer that this last case is intentionally problematic.

wjwwood avatar Apr 03 '17 18:04 wjwwood

I understand this issue needs to be addressed, but since the / is not valid in topic names, I think presenting the first option can lead to confusion. Let me propose a rephrase of that section.

miguelprada avatar Apr 04 '17 10:04 miguelprada

From what I understand in the linked spec, DDS topics don't exclude a forward slash. AFAIS, it only has a special meaning within the SQL Extension of rti. With that in mind, you could imagine a ROS2 independent DDS topic with a forward slash. If you want to subscribe to such a topic, you may not be able to apply the same topic rules as for ROS2.

But I have to do some more research on that.

Karsten1987 avatar Apr 04 '17 18:04 Karsten1987

DDS topics only allow alphanumeric and underscores (and must not start with a number) according to the spec:

In DDS, topic names are restricted by these restrictions:

From DDS 1.4 specification, or the RTI documentation:

TOPICNAME - A topic name is an identifier for a topic, and is defined as any series of characters 'a', ..., 'z', 'A', ..., 'Z', '0', ..., '9', '_' but may not start with a digit. Note: that the DDS specification has a known typo, where it says - are allowed, but the RTI documentation correctly lists _ as allowed.

Additionally, DDS - or more precisely the underlying RTPS protocol - has a hard limit on topic names of 256 characters, so an additional goal is to minimize the number of extra characters used when mapping from ROS to DDS names. See The Real-time Publish-Subscribe Protocol (RTPS) DDS Interoperability Wire Protocol Specification, Table 9.12 for more details.

-- http://design.ros2.org/articles/topic_and_service_names.html#dds-topic-names

@Karsten1987 What makes you think forward slash is allowed in a topic name? It might be allowed by the implementation, but we have to go by the specification since we're not tied to one implementation.

wjwwood avatar Apr 04 '17 20:04 wjwwood

I totally agree with what you said. We will comply to the specification, however, as you already mentioned, the implementations may be relaxed on these and you technically could end up with one forward slash in a DDS topic. If so, the question would be if we excluded that topic from being available in ROS.

If we decide to not allow the forward slash, then I like the proposed rephrasing of this PR.

Karsten1987 avatar Apr 04 '17 20:04 Karsten1987

I see what you mean, we can let the user pass a / into a DDS topic name by using "exact", and if the implementation doesn't allow it, let it raise. Basically "exact" would circumvent all of our checking.

wjwwood avatar Apr 04 '17 22:04 wjwwood