ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

New publisher discovered on topic 'zed/right/image_rect_color', offering incompatible QoS. No messages will be received from it. Last incompatible policy: RELIABILITY

asked 2022-01-16 15:51:42 -0500

KhalidOwlWalid gravatar image

updated 2022-01-16 15:53:01 -0500

I am trying to get the image from my zed camera but I keep countering this problem

[WARN] [1642368218.939085940] [bounding_box_node]: New publisher discovered on topic 'zed/right/image_rect_color', offering incompatible QoS. No messages will be received from it. Last incompatible policy: RELIABILITY
Traceback (most recent call last):
  File "/home/shenowlshoot/eufs-master/install/simulate_bounding_boxes/lib/simulate_bounding_boxes/bounding_box", line 11, in <module>
    load_entry_point('simulate-bounding-boxes==0.0.0', 'console_scripts', 'bounding_box')()
  File "/home/shenowlshoot/eufs-master/install/simulate_bounding_boxes/lib/python3.8/site-packages/simulate_bounding_boxes/draw_boundary_box.py", line 70, in main
    rclpy.spin_once(draw_boundary_box_node)
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/__init__.py", line 176, in spin_once
    executor.spin_once(timeout_sec=timeout_sec)
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py", line 707, in spin_once
    raise handler.exception()
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/task.py", line 239, in __call__
    self._handler.send(None)
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py", line 415, in handler
    await call_coroutine(entity, arg)
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py", line 340, in _execute_subscription
    await await_or_execute(sub.callback, msg)
  File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py", line 107, in await_or_execute
    return callback(*args)
  File "/opt/ros/galactic/lib/python3.8/site-packages/message_filters/__init__.py", line 83, in callback
    self.signalMessage(msg)
  File "/opt/ros/galactic/lib/python3.8/site-packages/message_filters/__init__.py", line 64, in signalMessage
    cb(*(msg + args))
  File "/opt/ros/galactic/lib/python3.8/site-packages/message_filters/__init__.py", line 230, in add
    while len(my_queue) > self.queue_size:
TypeError: '>' not supported between instances of 'int' and 'QoSProfile'
  • I have been trying to override my zed's camera QoS but nothing is working. It keeps on giving me the error above.

    • I also have no idea what that TypeError means and I cant seem to find anything about it online.

Here is my script that I am trying to implement:

#!/usr/bin/env python

import rclpy
import time
import cv2
import message_filters

from cv_bridge import CvBridge, CvBridgeError
from rclpy.qos import qos_profile_sensor_data, QoSProfile

from rclpy.node import Node
from sensor_msgs.msg import Image, CameraInfo
from image_geometry import PinholeCameraModel
from eufs_msgs.msg import BoundingBoxes


class DrawBoundingBox():

    def __init__(self):

        self.camera_image_topic = 'zed/right/image_rect_color'

        qos_profile = QoSProfile(reliability=rclpy.qos.ReliabilityPolicy.BEST_EFFORT,
                                          history=rclpy.qos.HistoryPolicy.KEEP_LAST,
                                          depth=5)

        self.bridge = CvBridge()

        self.image_sub = message_filters.Subscriber(
            draw_boundary_box_node,
            Image,
            self.camera_image_topic)

        self.bounding_box_sub = message_filters.Subscriber(
            draw_boundary_box_node,
            BoundingBoxes,
            '/simulate_bounding_boxes')

        sync_ = message_filters.TimeSynchronizer([self.image_sub, self.bounding_box_sub], qos_profile)
        sync_.registerCallback(self.image_callback)


    def image_callback(self, image_msg, bounding_box_msg):
        # Solve perception here

        pass


def main(args=None):

    global draw_boundary_box_node

    rclpy.init(args=args)

    draw_boundary_box_node = rclpy.create_node('bounding_box_node')

    draw_bounding_box = DrawBoundingBox()

    try:
        while rclpy.ok():
            rclpy.spin_once(draw_boundary_box_node)

    except KeyboardInterrupt:
        pass

    draw_bounding_box.destroy_node()

    rclpy.shutdown()


if __name__ == '__main__':
    main()

I have read this documentation here, but it seems that it is only for rclcpp and I cant find anything like get_rmw_qos_profile() for rclpy

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-01-18 13:16:35 -0500

KhalidOwlWalid gravatar image

So, I just realized my mistake.

 sync_ = message_filters.TimeSynchronizer([self.image_sub, self.bounding_box_sub], qos_profile)

I should not have use qos_profile as my queue size, and just use

 sync_ = message_filters.TimeSynchronizer([self.image_sub, self.bounding_box_sub], 10)

When subscribing to the image topic, this is where I should have use my qos_profile_sensor_data

    self.image_sub = message_filters.Subscriber(
        draw_boundary_box_node,
        Image,
        self.camera_image_topic,qos_profile=qos_profile)
edit flag offensive delete link more

Comments

1

Thank you for sharing your finding.

osilva gravatar image osilva  ( 2022-01-18 15:14:53 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-01-16 15:51:42 -0500

Seen: 1,041 times

Last updated: Jan 18 '22