I am using an Astra S camera (with supplied USB-A cable) and an Astra Stereo S camera (with user-supplied USB-C cable to an SS port). They show up under Device Manager. The cameras are not connected to the computer at the same time, so the software sees only one at a time.
Because I did not see any further instructions with the cameras, I assume that there is not a separate power switch, and that attaching the camera to the USB cable then to the computer makes it fully powered and operational.
I am using Visual Studio 2019 downloaded as the Community version. I am attempting to use the tutorial code under ‘API How-To C++’ in the v2.1.1-version of Orbbec’s ‘AstraSDK_Doc_en.chm’ user guide file. This code uses the polling method to retrieve a frame, and I have not tried the accompanying listening-method code. Although for some of the code I get the expected “hit enter to exit program” message in the output window, I do not get any diagnostic messages from either camera.
The problem comes when the output window ‘hangs’ with just the cursor blinking after I add the two code lines:
astra::Frame frame = reader.get_latest_frame();
[and]
const auto depthFrame = frame.getastra::DepthFrame();
Using the debugging option, after adding the next suggested code line:
const int frameIndex = depthFrame.frame_index();
I get a message at line 547 of Image.hpp that it “Cannot operate on an invalid frame”. The user guide seems to not address what to do in this situation.
Is the problem with my camera(s), or with the code?