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

Non standard msg modules #735

Merged
merged 3 commits into from
Jun 9, 2022

Conversation

zflat
Copy link
Contributor

@zflat zflat commented Apr 29, 2022

Public API Changes
None

Description
This is a bug fix relating to parsing the python module and class names of message and service type strings when non-standard submodule naming is used.

I have an application that has generated messages in a namespace that is not msg. For example, I want to subscribe to a message type 'my_package_interface/msg_core/MyMessage'. However, the ros_loader.py method _get_msg_class discards submodule information 'msg_core' and assumes the subname will be named 'msg' causing an InvalidModuleException to be raised.

I like that the message type parsing is flexible and able to accommodate ROS1 style types that don't have a submodule subname in the type string. However, I think that logic is too strict because it assumes the submodule subname and prevents any naming other than msg.

Note that I am trying to use the term "submodule" as it is used in https://docs.python.org/3/tutorial/modules.html even though it could be confused with git submodule.

@zflat
Copy link
Contributor Author

zflat commented May 13, 2022

@jtbandes @amacneil Can I please get a review of this change?

@defunctzombie
Copy link
Contributor

@zflat At the risk of sounding like I'm answering your question by saying "why don't you do it the default way ever other package does it" - I am wondering what pushed you to need the custom submodule naming? You can already control the package name and the message names; does the submodule name get you additional naming that is necessary?

@zflat
Copy link
Contributor Author

zflat commented May 18, 2022

why don't you do it the default way ever other package does it?

I am not the author of the messages package that I need to interface with. Also, the code I am adding is not complex and it makes less assumptions than the "only one way to do it" approach.

@zflat
Copy link
Contributor Author

zflat commented Jun 2, 2022

@amacneil Can I please get a review of this bug fix?

@defunctzombie
Copy link
Contributor

@jtbandes Is the rolling CI failure a known issue?

LGTM otherwise.

@jtbandes
Copy link
Member

jtbandes commented Jun 8, 2022

Rolling should be fixed if you rebase on #746

@zflat zflat force-pushed the non_standard_msg_modules branch from 31566ea to fb5aeff Compare June 8, 2022 21:05
@zflat
Copy link
Contributor Author

zflat commented Jun 9, 2022

@defunctzombie @jtbandes I rebased and pushed but there still is a failure in CI. I have seen that failure in other recent CI builds but it seems to be an intermittent failure.

@defunctzombie defunctzombie merged commit 277d260 into RobotWebTools:ros2 Jun 9, 2022
@zflat zflat deleted the non_standard_msg_modules branch June 11, 2022 17:23
jihoonl pushed a commit to floatic-unicorn/rosbridge_suite that referenced this pull request Oct 6, 2022
This is a bug fix relating to parsing the python module and class names of message and service type strings when non-standard submodule naming is used.

I have an application that has generated messages in a namespace that is not msg. For example, I want to subscribe to a message type 'my_package_interface/msg_core/MyMessage'. However, the ros_loader.py method _get_msg_class discards submodule information 'msg_core' and assumes the subname will be named 'msg' causing an InvalidModuleException to be raised.

I like that the message type parsing is flexible and able to accommodate ROS1 style types that don't have a submodule subname in the type string. However, I think that logic is too strict because it assumes the submodule subname and prevents any naming other than msg.

Note that I am trying to use the term "submodule" as it is used in https://docs.python.org/3/tutorial/modules.html even though it could be confused with git submodule.

Co-authored-by: William Wedler <william.wedler@resquared.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants