Skip to content
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

Update ROS node graph API #387

Merged
merged 3 commits into from
May 10, 2019
Merged

Update ROS node graph API #387

merged 3 commits into from
May 10, 2019

Conversation

jacobperron
Copy link
Member

The node function get_topic_names_and_types() now returns a vector for each type name
containing the parts of the fully qualified name.

Connects to ros2/ros2#677

@jacobperron jacobperron self-assigned this Mar 27, 2019
@jacobperron jacobperron added in progress Actively being worked on (Kanban column) in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Mar 27, 2019
Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I think this is a step backwards for the user facing API, because it makes it harder to consume when you care about the whole type and requires the user to manually concatenate the parts. Would it not be better to leave this API as-is and then provide a new API that gives it in parts, e.g. get_topic_names_and_split_types()?

@wjwwood
Copy link
Member

wjwwood commented Mar 27, 2019

Another name might be get_topic_names_and_type_tuples(). Also, why is the type a vector rather than a tuple or array? The number of elements doesn't change does it?

@jacobperron
Copy link
Member Author

jacobperron commented Mar 27, 2019

Personally, I think this is a step backwards for the user facing API, because it makes it harder to consume when you care about the whole type and requires the user to manually concatenate the parts

Yeah, I was kind of feeling the same as I was writing this. I was just propagating the change from rmw (ros2/rmw#170).

Would it not be better to leave this API as-is and then provide a new API that gives it in parts

This sounds like a better option. Still, the idea was to remove possible ambiguity from the type name (see ros2/design#220 and ros2/rmw_opensplice#263 (comment)) and so the concatenated string would be "pkg_name/namespace/TypeName". But I believe rviz is still expecting the form "pkg_name/TypeName"?

Also, why is the type a vector rather than a tuple or array? The number of elements doesn't change does it?

In the current IDL pipeline, I don't think it's possible for there to be more than three elements (I might be wrong). But I was proposing that there could be any number of parts to the namespace in ros2/design#220. This can still be discussed there and changed accordingly.
Edit: it could certainly be an array.

@wjwwood
Copy link
Member

wjwwood commented Mar 27, 2019

so the concatenated string would be "pkg_name/namespace/TypeName".

That would be fine for me.

But I believe rviz is still expecting the form "pkg_name/TypeName"?

That's possible, but I'd prefer to see us move towards the new style (pkg_name/msg/TypeName), and then let rviz allow for plugin descriptions to still use pkg_name/TypeName by implicitly inserting msg/ after the first /, perhaps making a deprecation warning at the same time.

In the current IDL pipeline, I don't think it's possible for there to be more than three elements (I might be wrong). But I was proposing that there could be any number of parts to the namespace in ros2/design#220. This can still be discussed there and changed accordingly.
Edit: it could certainly be an array.

I was just curious about this, if it needs to be a vector that's ok by me.

@jacobperron jacobperron added in progress Actively being worked on (Kanban column) and removed in review Waiting for review (Kanban column) labels Mar 28, 2019
@jacobperron
Copy link
Member Author

Decided to keep the type as a / delimited string rather than returning a nested list to keep the API simpler.

I'm not sure what (if anything) needs to be done to handle cases when more than two parts are returned (ie. pkg_name/msg/TypeName).

@dirk-thomas dirk-thomas added the bug Something isn't working label May 9, 2019
If there are only two parts to a type name, log a warning and insert the 'msg' namespace.
This is under the assumption that all plugins are supporting types in the 'msg' namespace.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Member Author

Ready for review.

I've updated all of the default plugins to declare the type's full namespace (e.g. sensor_msgs/msg/Image).
To provide maintainers for thirdparty plugins a chance to update, we assume that they intended to include the msg part of the namespace and log a warning.

@jacobperron jacobperron added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels May 9, 2019
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Member Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@jacobperron
Copy link
Member Author

I don't know why the macOS is showing unstable. There are no test failures, but some warnings produced when running the tests. The warnings are also on Linux, but it is green. I also checked locally that the warnings existed prior to the change introduced in this PR.

@jacobperron jacobperron merged commit 08ec705 into ros2 May 10, 2019
@jacobperron jacobperron deleted the message_namespace branch May 10, 2019 16:43
@jacobperron jacobperron removed the in review Waiting for review (Kanban column) label May 10, 2019
@wjwwood
Copy link
Member

wjwwood commented May 20, 2019

@jacobperron if you have a moment can you add a note to https://index.ros.org/doc/ros2/Releases/Release-Dashing-Diademata/#changes-since-the-crystal-release about the need for plugins to update their plugin descriptions, otherwise they get a warning?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants