Skip to content

print warning if event callback is not supported instead of passing e…#2648

Merged
ahcorde merged 1 commit intorollingfrom
fujitatomoya/event-callback-not-supported
Oct 9, 2024
Merged

print warning if event callback is not supported instead of passing e…#2648
ahcorde merged 1 commit intorollingfrom
fujitatomoya/event-callback-not-supported

Conversation

@fujitatomoya
Copy link
Copy Markdown
Collaborator

…xception.

replaces #2644

  • RMW implementation (in this particular case, that means rmw_zenoh) might not support those publisher / subscription event callbacks. I think that is okay to return UNSUPPORTED from RMW implementation. (RMW implementation does not have to support all RMW interfaces.)
  • It should not generate the exception if the underlying RMW implementation does not support this feature. because this can break the user application just to switch the rmw implementation when it starts running. (switching rmw_zenoh can generate the exception but rmw_fastrtps, this situation should be avoided.)

…xception.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Copy link
Copy Markdown
Collaborator Author

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

@Yadunund @ahcorde
this is related to #2644, could you guys take a look?

Comment on lines -163 to +178
RCLCPP_DEBUG(
RCLCPP_WARN(
rclcpp::get_logger("rclcpp"),
"Failed to add event handler for incompatible qos; wrong callback type");
"Failed to add event handler for incompatible qos; not supported");
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think warning is more appropriate here, this is more visible for user that the callback type is not supported with this rmw implementation. besides, message is wrong, that is just not supported.

Copy link
Copy Markdown
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

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

This is a much better solution! Thanks @fujitatomoya

@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Oct 9, 2024

Pulls: #2648
Gist: https://gist.githubusercontent.com/ahcorde/d54130fc9cfad4d3d085a9d80124daa7/raw/00d63472a38f1fd0b1fb2a881a59a01cf9c8b665/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp --packages-above-and-dependencies rclcpp
TEST args: --packages-above rclcpp --packages-above rclcpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14683

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit 41d3a27 into rolling Oct 9, 2024
@ahcorde ahcorde deleted the fujitatomoya/event-callback-not-supported branch October 9, 2024 13:22
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.

3 participants