Fov of depth camera different to non depth camera

Hi there
I am simulating a stereo camera in gazebo and am working on the depth ground truth from a depth camera. These two sensor have different fovs.
Left (reference) stereo camera:

<sensor name="camera_sensor_right" type="camera">
        <pose >0.112 0 -0.052 0.0099771 1.5970566 1.5671158 </pose>
        <camera name="OV7521">
            <type>stereographic</type> <!-- Type of the lens mapping -->
            <scale_to_hfov>true</scale_to_hfov> <!-- If true the image will be scaled to fit horizontal FOV -->
            <cutoff_angle>3.14</cutoff_angle> <!-- camera angle outside of which everything is hidden -->
            <env_texture_size>640</env_texture_size> <!-- resolution of the cubemap texture -> image sharpness (default : 256)-->
              <fx>256.666691776 </fx> <!-- in pixels (default : 257.1726164141661) -->
              <fy>254.19732909</fy> <!-- in pixels (default : 254.75785544530143) -->
              <cx>353.781709595</cx> <!-- in pixels (default : 354.04231531997004) -->
              <cy>236.287076</cy> <!-- in pixels (default : 235.46582540891967) -->
            <k1>0.9322052742586934</k1--> <!-- field-of-view of the ideal fish-eye lens (FOV MODEL)-->
            <!--center>0.552783921242578 0.492264741665797</center-->  <!-- cx and cy in normalized coordinates -->
            <width>640</width> <!-- in pixels (default : 640) -->
            <height>480</height> <!-- in pixels (default : 480) -->

          <!--  Gaussian-sampled "output amplifier noise" between 0 and 1 added independently to each 
          color channel of each pixel & converted to an unsigned integer (0-255) in the image using 8 
          bits per channel via a GLSL shader (GPU required). -->
            <stddev>0.0</stddev> <!-- recommended value : 0.007-->

          <!--save enabled="true">


So I have a focal length fx of 256.667 (pixels) and a resolution in x direction of 640 pixels. Calculating the fov manually using the formula

FoV = 2 × arctan(w / 2f)

I get 102.534957338 degrees. Which converts to 1.789572604 radians.

Depth camera:

<sensor type="depth" name="GT">
        <pose >0.02 0 -0.052 0.0099771 1.5970566 1.5671158 </pose>
        <camera name="GT_camera">
            <!-- Noise is sampled independently per pixel on each frame.
                That pixel's noise value is added to each of its color
                channels, which at that point lie in the range [0,1]. -->

I noticed that using the parameters of focal length didn’t have any impact on the depth camera so I played around and found that manually setting the fov has an impact. I placed the calculated value but the images are still not aligned. (I also set the scale_to_hfov parameter to true for all of the cameras but still.

Here is an image of the result (left: left camera, right: depth camera gt at left position): (As can be seen the depth camera still seems a bit zoomed in compared to the reference image)

Thanks a lot for any ideas on this.

A few points that might help:

  • I’m working with gazebo garden
  • I’m using the gazebo-ros2 bridge and ros-ros2 bridge as my code will have to run on ros.