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

Revision history [back]

I think you might be running into Quality of Service (QoS) incompatibilities.

As far as I know the gazebo plugin publishes with the "sensor data" QoS profile ("best effort" reliability), and your subscriber is using "reliable" reliability. If you try to echo the message with ros2 topic echo /camera/image_raw --no-arr and you manage to see the image data, then that confirms the issue is with your MinimalSubscriber.

You can switch to the sensor data QoS profile by changing your subscription creation to:

self.subscription = self.create_subscription(
    Image,
    '/camera/image_raw',
    self.listener_callback,
    qos_profile_sensor_data)

(Add from rclpy.qos import qos_profile_sensor_data to the top of your node to get that.)