gz-sensors icon indicating copy to clipboard operation
gz-sensors copied to clipboard

Intrinsic matrix of Bounding Box Camera is not correctly published

Open wittenator opened this issue 4 months ago • 0 comments

Environment

  • OS Version: Ubuntu 22.04
  • Source or binary build? Binary: Harmonic

Description

This is a continuation of the previous ticket. I have a normal camera sensor and the bounding box sensor in my sdf and falsely attributed the intrinsic matrix to the wrong camera. The CameraInfo is correct if I have a look at the camera sensor, but not correct for the bbox camera. This sounds curious since afaik the bbox camera inherits from the normal camera sensor. This may be connected to #363 .

  • Expected behavior: The camera info topic should correctly reflect the intrinsic properties of the camera
  • Actual behavior: The camera info contains default values that do no get changed.

Steps to reproduce and output

  1. Insert a camera sensor with non-default parameters e.g.
<sensor name="boundingbox_camera" type="boundingbox_camera">
          <gz_frame_id>camera_link_optical</gz_frame_id>
          <camera>
            <horizontal_fov>1.478294</horizontal_fov>
            <image>
              <width>640</width>
              <height>480</height>
            </image>
            <clip>
              <near>0.01</near>
              <far>60</far>
            </clip>
          </camera>
          <always_on>1</always_on>
          <update_rate>20</update_rate>
          <visualize>false</visualize>
        </sensor>
  1. Subscribe to the /camera_info topic. This yields the following message:
header {
  stamp {
    sec: 47
  }
  data {
    key: "frame_id"
    value: "camera_link_optical"
  }
}
width: 640
height: 480
distortion {
  k: 0
  k: 0
  k: 0
  k: 0
  k: 0
}
intrinsics {
  k: 277
  k: 0
  k: 160
  k: 0
  k: 277
  k: 120
  k: 0
  k: 0
  k: 1
}
projection {
  p: 277
  p: 0
  p: 160
  p: 0
  p: 0
  p: 277
  p: 120
  p: 0
  p: 0
  p: 0
  p: 1
  p: 0
}
rectification_matrix: 1
rectification_matrix: 0
rectification_matrix: 0
rectification_matrix: 0
rectification_matrix: 1
rectification_matrix: 0
rectification_matrix: 0
rectification_matrix: 0
rectification_matrix: 1

The correct intrinsic matrix would look like this though:

[[351.05947319   0.         320.        ]
 [  0.         368.86247951 240.        ]
 [  0.           0.           1.        ]]

wittenator avatar Apr 04 '24 19:04 wittenator