-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhanced ros2 topic info to display node name, node namespace, topic type and qos profile of the publishers and subscribers. #385
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
5745b57
to
9b262af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -25,6 +51,10 @@ def add_arguments(self, parser, cli_name): | |||
arg = parser.add_argument( | |||
'topic_name', | |||
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, ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ros2topic/ros2topic/verb/info.py
Outdated
except NotImplementedError as e: | ||
logger.warning(str(e)) | ||
except Exception as e: | ||
logger.error(str(e)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the parenthesis.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the parenthesis.
ros2topic/ros2topic/verb/info.py
Outdated
@@ -40,5 +70,10 @@ def main(self, *, args): | |||
return "Unknown topic '%s'" % topic_name | |||
type_str = topic_types[0] if len(topic_types) == 1 else topic_types | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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
ros2cli
layer can now use thenode.get_publishers_info_by_topic
andnode.get_subscriptions_info_by_topic
functions to enhance the output ofros2 topic info <topic_name>
as follows:Related to issues in aws-roadmap #86