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

Loading image_rotate::ImageRotateNode as component #820

Conversation

2b-t
Copy link

@2b-t 2b-t commented Jun 1, 2023

It seems that on the ROS 2 branches (at least for Humble, Galactic and Foxy) the image_rotate::ImageRotateNode
is still exported with the CLASS_LOADER_REGISTER_CLASS macro:

#include "class_loader/register_macro.hpp"
// Register the component with class_loader.
CLASS_LOADER_REGISTER_CLASS(image_rotate::ImageRotateNode, rclcpp::Node)

Similarly to #691 the component is displayed when listing all component types with:

$ ros2 component types
...
image_rotate
  image_rotate::ImageRotateNode
...

but results in a runtime error when trying to load it into a component_container

$ ros2 run rclcpp_components component_container
$ ros2 component load /ComponentManager image_rotate image_rotate::ImageRotateNode
[INFO] [1685614749.711272077] [ComponentManager]: Load Library: /opt/ros/humble/lib/libimage_rotate.so
[ERROR] [1685614749.744623406] [ComponentManager]: Failed to find class with the requested plugin name 'image_rotate::ImageRotateNode' in the loaded library

This pull request fixes this by replacing the CLASS_LOADER_REGISTER_CLASS macro with the RCLCPP_COMPONENTS_REGISTER_NODE macro and updating image_rotate::ImageRotateNode's constructor to take const rclcpp::NodeOptions& options as an argument.

@2b-t 2b-t changed the title fix: Fix loading image_rotate::ImageRotateNode as component Loading image_rotate::ImageRotateNode as component Jun 1, 2023
@mikeferguson
Copy link
Member

This is failing CI - and I can't add changes - updated version in #855, #856, #857

mikeferguson added a commit that referenced this pull request Jan 18, 2024
This is a fixed version of #820 - targeting rolling
mikeferguson added a commit that referenced this pull request Jan 19, 2024
This is a fixed version of #820 - targeting humble
mikeferguson added a commit that referenced this pull request Jan 19, 2024
This is a fixed version of #820 - targeting iron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants