Items with no label
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
3338 討論

D435 camera :no depth data received

mzhou1
初學者
3,028 檢視

i connect the D435 camera to PC(windows 7), install the realsense sdk 2.0, open the intel realsense viewer(win 7), it works fine ,i can see both depth and rgb image, the i open the example program; there is a hello-world program:

using namespace rs2;

void main()

{

// Create a Pipeline, which serves as a top-level API for streaming and processing frames

pipeline p;

// Configure and start the pipeline

p.start();

while (true)

{

// Block program until frames arrive

frameset frames = p.wait_for_frames();

// Try to get a frame of a depth image

depth_frame depth = frames.get_depth_frame();

// The frameset might not contain a depth frame, if so continue until it does

if (!depth) continue;

// Get the depth frame's dimensions

float width = depth.get_width();

float height = depth.get_height();

// Query the distance from the camera to the object in the center of the image

float dist_to_center = depth.get_distance(width / 2, height / 2);

// Print the distance

std::cout << "The camera is facing an object " << dist_to_center << " meters away \r";

}

}

the depth is always NULL, the program cannot output the distance value;

then i open the realsense viewer, it show usb cam overflow.

why is that?

Did i miss something, or config the vs studio? i am using vs 2015 community version.

0 積分
6 回應
MartyG
榮譽貢獻者 III
961 檢視

Does the example program work if you run it without having opened the RealSense Viewer beforehand, please?

mzhou1
初學者
961 檢視

no, the example program does not work if the realsense viewer didnot open beforehand.

even i restart my computer, then run the example, no data received.

idata
員工
961 檢視

Hi Michael,

 

 

Have you tried running any of the C or C++ examples included in the SDK? The code you provided is just a code snippet and isn't meant to be a full program. The rs-distance example uses the code snippet above in a full program.

 

 

Regards,

 

Sahira

 

 

mzhou1
初學者
961 檢視

this is a example code included in sdk, i open the program though the shortcut in desktop.

idata
員工
961 檢視

Hi Michael,

 

Just to be clear, only the hello-world example does not work? Have you tried the other examples from the SDK?

 

 

Regards,

 

Sahira
_xct
初學者
961 檢視

Are you sure you're using usb3 port AND usb3 cable? Otherwise, you're in for a myriad of issues.

回覆