Enhanced ros2 topic info to display node name, node namespace, topic type and qos profile of the publishers and subscribers.#385
Conversation
76a106f to
dde5dea
Compare
5745b57 to
9b262af
Compare
hidmic
left a comment
There was a problem hiding this comment.
I think this is the first time we expose the RMW message type name. I can see value in providing such information, but this is not how we usually refer to topic types i.e. we use std_msgs/msg/String, not std_msgs::msg::dds_::String_. @dirk-thomas @jacobperron do you recall if we provide an API somewhere to carry out the conversion?
ros2topic/ros2topic/verb/info.py
Outdated
| help="Name of the ROS topic to get info (e.g. '/chatter')") | ||
| parser.add_argument( | ||
| '--verbose', '-v', action='store_true', | ||
| help='Prints detailed information like the Node Name, Node Namespace, Topic Type, ' |
ros2topic/ros2topic/verb/info.py
Outdated
| except NotImplementedError as e: | ||
| logger.warning(str(e)) | ||
| except Exception as e: | ||
| logger.error(str(e)) |
ros2topic/ros2topic/verb/info.py
Outdated
| if (args.verbose): | ||
| print_topic_info(topic_name, node.get_publishers_info_by_topic) | ||
| print('\nSubscription count : %d' % node.count_subscribers(topic_name)) | ||
| if (args.verbose): |
ros2topic/ros2topic/verb/info.py
Outdated
| print('Publisher count: %d' % node.count_publishers(topic_name)) | ||
| print('Subscriber count: %d' % node.count_subscribers(topic_name)) | ||
| print('\nPublisher count : %d' % node.count_publishers(topic_name)) | ||
| if (args.verbose): |
ros2topic/ros2topic/verb/info.py
Outdated
| print('Type: %s' % type_str) | ||
| print('Publisher count: %d' % node.count_publishers(topic_name)) | ||
| print('Subscriber count: %d' % node.count_subscribers(topic_name)) | ||
| print('\nPublisher count : %d' % node.count_publishers(topic_name)) |
There was a problem hiding this comment.
nitpick: it looks odd to me with the added whitespace before the colon, especially when Type: does not have the same alignment. IMO, it looks fine without the added whitespace.
Not off the top of my head. I wonder if the displayed type in verbose mode will confuse users, since it is language-specific and rmw-implementation specific. We're also displaying the ROS type (e.g. |
If |
hidmic
left a comment
There was a problem hiding this comment.
Also, I've just realized this has no associated test.
|
The mangled type name is being discussed and addressed in ros2/rmw_fastrtps#336. I'll add some tests to this pull request. Thanks. |
f035b9f to
ebdbb10
Compare
|
Hi @hidmic, I have fixed and added some tests regarding the verbose mode of |
|
Is it okay to merge this as well now that ros2/rclcpp#960 and ros2/rclpy#454 are merged, @hidmic, @ivanpauno, @wjwwood? |
|
Let me re-review it, and it will need CI after that I think. |
|
Oh okay, I was under the impression that the CI run at ros2/rclpy#454 (comment) already included |
|
That's possible, though I didn't assume that. Any ways it would be good to double check after I review. Could be |
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
baed2dc to
4c6eaec
Compare
|
Not sure what the issue was CI failed, and the tests ran for like an hour before failing... |
|
I find that the |
|
I see a bunch of: That's because the function is not implemented in |
|
I don't understand why it's an issue causing the test to fail for |
Because that CI job didn't include opensplice. |
|
Does this comment still apply for the |
I think that not having an implementation in |
|
Hi @ivanpauno, the The full set of relevant pull requests is now:
Thanks |
|
@ros2/aws-oncall - please run this CI job |
This won't test |
|
@mm318 please fill in @ros2/aws-oncall with what |
|
Gist: https://gist.githubusercontent.com/prajakta-gokhale/3bfd17646ef9b816edbab230f73df9d2/raw/30b621cdf64821ec62dc94d4853aafce08e5e7af/ros2.repos Rebuilding Windows: |
|
@mm318 Can you also enable tests here https://github.com/ros2/rcl/blob/25f39c3a4867018f1140bec3ab904bd074a49849/rcl/test/rcl/test_info_by_topic.cpp#L57? Thanks! |
|
Another run, including the enabled rcl tests: @mm318 I see that |
The faileres are definetly unrelated, I'm merging! |
NOTE: DO NOT MERGE until rmw #186, rmw_implementation #72, rcl #511 and rclpy #454 are merged.
This PR makes the necessary changes to implement this feature request. Once all the dependent PRs are merged, the
ros2clilayer can now use thenode.get_publishers_info_by_topicandnode.get_subscriptions_info_by_topicfunctions to enhance the output ofros2 topic info <topic_name>as follows:Related to issues in aws-roadmap #86