librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Depth settings causing error

Open Jason420Git opened this issue 9 years ago • 2 comments

Required Info
Camera Model D400
Firmware Version 5.8.5
Operating System & Version Windows 10

I have been unable to set the laser emitter power or depth presets without getting the following error:

"RealSense error calling rs2_query_sensors(device:nullptr): null poiinter passed for argument "device"

I am setting it with the following line of code:

m_rsDevice.first<rs2::depth_sensor>.set_option(rs2_option::RS2_OPTION_LASER_POWER, val);

I have tried this both before and after starting the camera

Jason420Git avatar Oct 31 '17 11:10 Jason420Git

Hi @Jason420Git , The error you are getting indicates that your m_rsDevice is "empty", meaning that you did not initialize it with a valid device. Please verify that it is valid (with if(m_rsDevice) { /*use m_rsDevice*/ }, and check you code before this validation to make sure you set it with a valid device.

zivsha avatar Oct 31 '17 13:10 zivsha

I was able to get this working. My setup may be a bit odd as I have my rs_device as a member to a class, I pass in the device from a function. It is a wrapper class around the realsense API.

Jason420Git avatar Oct 31 '17 16:10 Jason420Git