Skip to content

CameraRealSense2::init() fails for realsense D405 #1571

@gkoundry

Description

@gkoundry

I'm using the C++ API (no ROS) and when I call camera = new CameraRealSense2("D405"); it fails with the following error:

[ INFO] (2025-08-27 09:07:23.280) CameraRealSense2.cpp:617::init() Device Name: Intel RealSense D405
[ INFO] (2025-08-27 09:07:23.280) CameraRealSense2.cpp:620::init() Device FW version: 5.16.0.1
[ INFO] (2025-08-27 09:07:23.280) CameraRealSense2.cpp:623::init() Device Product ID: 0x0B5B
[ INFO] (2025-08-27 09:07:23.280) CameraRealSense2.cpp:633::init() Device Sensors: 
[ INFO] (2025-08-27 09:07:23.280) CameraRealSense2.cpp:701::init() Stereo Module was found.
terminate called after throwing an instance of 'rs2::error'
  what():  null pointer passed for argument "sensor"
Aborted (core dumped)

It is failing because the code expects both a RGB camera and stereo module but the D405 does not have a RGB sensor (see IntelRealSense/librealsense#11981).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions