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

Create a default warning for qos incompatibility #536

Conversation

emersonknapp
Copy link
Contributor

Signed-off-by: Emerson Knapp emerson.b.knapp@gmail.com

rclpy/rclpy/qos_event.py Outdated Show resolved Hide resolved
rclpy/rclpy/qos_event.py Outdated Show resolved Hide resolved
@emersonknapp emersonknapp added this to To do in Foxy API Freeze Apr 7, 2020
@emersonknapp emersonknapp marked this pull request as ready for review April 8, 2020 16:35
emersonknapp and others added 5 commits April 13, 2020 01:31
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
@mm318
Copy link
Member

mm318 commented Apr 13, 2020

This pull request has been updated to behave similarly to the rclcpp version (in ros2/rclcpp#1051).

@dirk-thomas dirk-thomas moved this from To do to In progress in Foxy API Freeze Apr 14, 2020
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Just one comment that I think needs to be addressed.

rclpy/rclpy/node.py Outdated Show resolved Hide resolved
rclpy/rclpy/node.py Outdated Show resolved Hide resolved
Signed-off-by: Miaofei <miaofei@amazon.com>
@mm318
Copy link
Member

mm318 commented Apr 15, 2020

@ros2/aws-oncall - please run this CI job
Gist: https://gist.githubusercontent.com/mm318/9ab95351a88ec18085660718f582912f/raw/779f53aa1e5ffcebc4c093d71f49bd5c7d2c97c4/ros2_incompatible_qos_callbacks.repos
BUILD args: --packages-up-to rclpy
TEST args: --packages-select rclpy
Job: ci_launcher

const char * node_logger_name = rcl_node_get_logger_name(pub->node);
if (NULL == node_logger_name) {
Py_RETURN_NONE;
}
Copy link
Member

Choose a reason for hiding this comment

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

This is fine, though I think that a bit unnecessary.

IMO, a nicer approach would have been the following:

callbacks = PublisherEventCallbacks()  # default callbacks is true, but they're not yet defined
# Default callbacks are added here, if `event_callbacks._use_default_callbacks` is true, and the user doesn't explicitly define that callback.
publisher = self.node.create_publisher(EmptyMsg, 'test_topic', 10, event_callbacks=callbacks)

In both cases the result the user sees is the same, so I won't block on the change.

Copy link
Member

@mm318 mm318 Apr 15, 2020

Choose a reason for hiding this comment

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

I thought about doing the way you mentioned, but with event_callbacks.incompatible_qos no longer None, it's harder to determine later on if it's the default one or a user provided one, which is needed to handle the UnsupportedEventTypeError exception differently.

Copy link
Member

Choose a reason for hiding this comment

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

I thought about doing the way you mentioned, but with event_callbacks.incompatible_qos no longer None, it's harder to determine later on if it's the default one or a user provided one, which is needed to handle the UnsupportedEventTypeError exception differently.

It could initially be None, except the user provided explicitly one.
If it's set to None and use default_callbacks is true, the event is registered with the default callback when the publisher is created.

I think the approach I'm mentioning is exactly the one used in rclcpp.

@piraka9011
Copy link

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

@mm318
Copy link
Member

mm318 commented Apr 15, 2020

  • Windows Build Status

Looks to me like the build test failures on Windows are unrelated, @ivanpauno.

@jacobperron
Copy link
Member

FYI, I think this change is going to cause a string of new test failures in ros2cli, as the warning appears when running various CLI tools (e.g. ros2 topic echo).

@dirk-thomas
Copy link
Member

FYI, I think this change is going to cause a string of new test failures in ros2cli, as the warning appears when running various CLI tools (e.g. ros2 topic echo).

@emersonknapp @mm318 @ros2/aws-oncall FYI

@emersonknapp
Copy link
Contributor Author

Thx for the heads up. Saw one such test failure in rosbag2, though that was resolvable by making the test less fragile. CLI is a bit different

@dirk-thomas
Copy link
Member

See https://ci.ros2.org/job/ci_linux/10244/testReport/ for a list of test failures in the ros2cli repo.

@nuclearsandwich
Copy link
Member

@emersonknapp since this PR will introduce test failures. I'm wondering if we should revert it before the nightlies and explore solutions in the morning?

@emersonknapp
Copy link
Contributor Author

I'm personally fine with that, I believe in a revert-friendly engineering culture. I'm unfortunately not at my computer for the remainder of the evening, if you or @mm318 would be able to do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

7 participants