gazebosim/gz-sensors

[CameraSensor] CameraInfo not published when there's no CameraImage subscriber

Opened this issue · 1 comments

Environment

  • OS Version: Ubuntu 20.04.5 LTS x86_64
  • Source or binary build? Gazebo Fortress from source (as of yesterday)

Description

  • Expected behavior: The CameraInfo should be published as soon as there's a listener on the CameraInfo topic.
  • Actual behavior: You need to manually view the image in the Gazebo GUI to trigger the publishing of the CameraInfo

Steps to reproduce

  1. Open a Gazebo world with a camera
  2. ign topic -l
  3. ign topic -e -n 1 -t camera/camera_info
  4. No data is echoed
  5. Click on the refresh button in Image Display
  6. The data should now be echoed in the terminal

Output

Before refresh:
image

After:
image

This issue was first noticed by myself while attempting to setup ros-ign-bridge. gazebosim/ros_gz#346

Update

By looking at the code, the problem seems to be present in all of the different camera sensors. I confirmed that the issue is present with the DepthCameraSensor since there's one present in my simulation.

Fixed by: #308