Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ROS2 Node for Object Detection 2D Gem gives Error #415

Closed
aselimc opened this issue Mar 1, 2023 · 1 comment · Fixed by #420
Closed

ROS2 Node for Object Detection 2D Gem gives Error #415

aselimc opened this issue Mar 1, 2023 · 1 comment · Fixed by #420
Assignees
Labels
bug Something isn't working

Comments

@aselimc
Copy link
Collaborator

aselimc commented Mar 1, 2023

Hello,

I was trying to write ROS2 nodes for the new algorithm that I am implementing "CL-Slam". Here we use message_filters similar to projects/opendr_ws_2/opendr_percteption/opendr_perception/object_detection_2d_gem_node.py. Here in the lines 190-191:

msg_rgb = message_filters.Subscriber(self, ROS_Image, input_rgb_image_topic, 1)
msg_ir = message_filters.Subscriber(self, ROS_Image, input_infra_image_topic, 1)

This gives the following error:

gem_node = ObjectDetectionGemNode(
  File "/home/canakcia/opendr/projects/opendr_ws_2/install/opendr_perception/lib/python3.8/site-packages/opendr_perception/object_detection_2d_gem_node.py", line 190, in __init__
    msg_rgb = message_filters.Subscriber(self, ROS_Image, input_rgb_image_topic, 1)
  File "/opt/ros/foxy/lib/python3.8/site-packages/message_filters/__init__.py", line 80, in __init__
    self.sub = self.node.create_subscription(*args[1:], self.callback, **kwargs)
TypeError: create_subscription() got multiple values for argument 'qos_profile'

I currently don't have a suggestion to fix this and I am investigating it for CL-SLAM and I can provide a solution if I find one. I simply tried deleting the 'qos_profile' size defined as 1 in the code. But for CL-SLAM case, this leads to another issue where the callback function is never called.

Edit: Actually, not sending the 'qos_profile' solves the problem. I suggest changing the lines 190-191 in the projects/opendr_ws_2/opendr_percteption/opendr_perception/object_detection_2d_gem_node.py to:

msg_rgb = message_filters.Subscriber(self, ROS_Image, input_rgb_image_topic)
msg_ir = message_filters.Subscriber(self, ROS_Image, input_infra_image_topic)
@aselimc aselimc added the bug Something isn't working label Mar 1, 2023
@jelledouwe
Copy link
Collaborator

Hi @aselimc,

Thanks for opening the issue and for proposing the fix! For me it solves the issue indeed. I created a PR: #420.

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

Successfully merging a pull request may close this issue.

2 participants