No depth image data from depth_camera plugin (Intel RealSense D415)

asked 2022-10-09 19:18:25 -0600

srsidd gravatar image

updated 2022-10-09 19:19:46 -0600

I'm running Ignition fortress with ROS 2 (galactic) and am trying to simulate the RealSense 415 depth camera. However, I'm having trouble with depth images - The images rendered are pitch black and don't show any depth.

Here is the snippet I use in my xacro -

  <gazebo reference="${name}_color_optical_frame">
    <sensor name='${name}_color_camera' type='camera'>
      <pose>0 0 0 1.57 -1.57 0</pose>
      <visualize>true</visualize>
      <update_rate>30</update_rate>
      <topic>/camera/color/image_raw</topic>
      <camera>
        <horizontal_fov>1.20428</horizontal_fov>
        <image>
          <width>1920</width>
          <height>1080</height>
        </image>
        <!-- <clip>
          <near>0.1</near>
          <far>100</far>
        </clip> -->
      </camera>
    </sensor>

    <sensor name="${name}_depth_camera" type="depth_camera">
      <pose>0 0 0 1.57 -1.57 0</pose>
      <visualize>true</visualize>
      <update_rate>10</update_rate>
      <topic>/camera/aligned_depth_to_color/image_raw</topic>
      <camera>
        <horizontal_fov>1.20428</horizontal_fov>
        <image>
          <width>1920</width>
          <height>1080</height>
          <format>R_FLOAT32</format>
        </image>
        <clip>
          <near>0.2</near>
          <far>5.0</far>
        </clip>
        <noise>
          <type>gaussian</type>
          <mean>0.0</mean>
          <stddev>0.100</stddev>
        </noise>
      </camera>
      <always_on>1</always_on>
    </sensor>
  </gazebo>

Here is a picture of what I see. The left is the image from the color camera and the right is the image from the depth camera - image description

I tried digging using the ign command line and there is no details on the sensor for the depth camera -

~$ ign model -s realsense_depth_camera -m ur_robot

Requesting state for world [empty]...

- Sensor [42]
  - Name: realsense_depth_camera
  - Parent: ur_robot [9]
  - Pose [ XYZ (m) ] [ RPY (rad) ]:
    [0.101556 -0.129982 0.014972]
    [-3.141590 -1.570790 0.000793]

But for the color camera I see a lot more details on the sensor

~$ ign model -s realsense_color_camera -m ur_robot

Requesting state for world [empty]...

- Sensor [41]
  - Name: realsense_color_camera
  - Parent: ur_robot [9]
  - Pose [ XYZ (m) ] [ RPY (rad) ]:
    [0.101556 -0.129982 0.014972]
    [-3.141590 -1.570790 0.000793]
  - Horizontal field of view (rad): 1.20428
  - Image width (px): 1920
  - Image height (px): 1080
  - Near clip (m): 0.1
  - Far clip (m): 100
  - Pixel format: RGB_INT8
  - Save frames: 0
  - Save frames path: 
  - Image noise:
    - Mean: 0
    - Bias mean: 0
    - Standard deviation: 0
    - Bias standard deviation: 0
    - Precision: 0
    - Dynamic bias standard deviation: 0
    - Dynamic bias correlation time (s): 0
  - Distortion K1: 0
  - Distortion K2: 0
  - Distortion K3: 0
  - Distortion P1: 0
  - Distortion P2: 0
  - Distortion center: 0.5 0.5
  - Lens type: stereographic
  - Lens scale to horizontal field of view (rad): 1
  - Lens C1: 1
  - Lens C2: 1
  - Lens C3: 0
  - Lens focal length (m): 1
  - Lens function: tan
  - Lens cutoff angle (rad): 1.5708
  - Lens texture size: 256
  - Lens intrinsics Fx: 277
  - Lens intrinsics Fy: 277
  - Lens intrinsics Cx: 160
  - Lens intrinsics Cy: 120
  - Lens intrinsics skew: 1
  - Visibility mask: 4294967295

Any leads on what I might be missing?

edit retag flag offensive close merge delete