0
$\begingroup$

Rosanswers logo

Hi, All.

When using the HelloWorld example of the C++ example in ROS2, it appears in the node list, but not in the topic list. Of course, when node_demos_cpp is used, it appears in the Topic list.

But I would like to use another DDS topic other than ROS2. (E. G., Using microRTPS, FastRTPS, etc.) Is there anything I have to do separately?

Does not the topic list of ROS2 fetch the topic list registered in DDS?


Originally posted by Kei on ROS Answers with karma: 28 on 2018-06-21

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Can you please link to the example you are referring to or share the code. Otherwise it is unclear what are a referencing.

Yes, it is supposed to show all ROS 2 specific DDS topics. But it doesn't show all native DDS topics.


Originally posted by Dirk Thomas with karma: 16276 on 2018-06-21

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Kei on 2018-06-21:
Thanks for your answer!

Can you tell me the difference between ROS2 specific DDS topics and native DDS topics? Are the ROS2 specific DDS topics such as std_msgs in ROS2?

Comment by Dirk Thomas on 2018-06-21:
The referenced example is not from ROS 2 but from FastRTPS - it doesn't contain any ROS specific code an won't appear in the ROS topic list. Please see http://design.ros2.org/articles/topic_and_service_names.html how ROS topic names are represented in DDS. Only those are reported by ros2 topic.

Comment by Kei on 2018-06-21:
Oh, thank you! The link you gave me was a great help :)

$\endgroup$
0
$\begingroup$

Rosanswers logo

Just FYI, the ros2 topic command is not capable of this right now, but you can use ROS 2 to list all topics even the ones not formatted as ROS 2 topics. See the Node.get_topic_names_and_types() method in rclpy has a no_demangle option:

https://github.com/ros2/rclpy/blob/601d286cb5e049d930883f4e8fa21b58f2a46550/rclpy/rclpy/node.py#L290-L291

Here's a short Python script that should list all topics, even non-ROS 2 ones:

import rclpy
rclpy.init()
node = rclpy.create_node('list_all_topics_example')
print(node.get_topic_names_and_types(no_demangle=True))

Originally posted by William with karma: 17335 on 2018-06-21

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by Kei on 2018-06-21:
Cool! It can check native DDS topics! It has really been a lot of help :)

Thanks!

Comment by mhallak on 2020-07-21:
Super cool... Thank you for the script!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.