I’ve been having trouble with the get_latest_frame method as shown in the Tutorial.
I’ve also had other problems with the tutorial that I had to hack away at for a while using this website, and it’d be great if the tutorial / setup instructions could include things like getting the dlls,OpenNI2 and Plugins folder, into the correct place.
I’ve checked the other related posts on here about this, but I’m just not getting it to work.
My code-
#include <astra/astra.hpp>
#include <cstdio>
#include <iostream>
int main(int argc, char** argv) {
astra::initialize();
astra::StreamSet streamSet;
astra::StreamReader reader = streamSet.create_reader();
reader.stream<astra::DepthStream>().start();
astra::Frame frame = reader.get_latest_frame();
const auto depthFrame = frame.get<astra::DepthFrame>();
const int frameIndex = depthFrame.frame_index();
const short pixelVal = depthFrame.data()[0];
std::cout
<< std::endl
<< "Depth frameIndex: " << frameIndex
<< " pixelValue: " << pixelVal
<< std::endl
<< std::endl;
astra::terminate();
std::cout << "hit enter to exit program" << std::endl;
std::cin.get();
return 0;
}
What things I’ve done/tried so far-
- Including libraries, linking to .h files, etc, as told to in the User Guide
- Adding in all the dlls from the Samples to my target directory
- Adding in the OpenNI2 and Plugins folders, from the OpenNI2 zip file, to my target directory
- Also including .h files and libraries from OpenNI2 directly
The program gets stuck on the get_latest_frame() line. This is the log file with Debug Level-
2019-08-12 20:12:14,683 WARN [context] Hold on to yer butts
2019-08-12 20:12:14,684 INFO [context] configuration path: C:\Users\f002sxf\Documents\Astra Try\x64\Debug\astra.toml
2019-08-12 20:12:14,684 INFO [context] log file path: astra.log
2019-08-12 20:12:14,684 INFO [context] astra_core library version: v2.0.16-e6b4f7afb2 API Level: 1
2019-08-12 20:12:14,684 INFO [context] astra_core_api library version: v2.0.16-e6b4f7afb2 API Level: 1
2019-08-12 20:12:14,684 INFO [context] plugin search paths C:\Users\f002sxf\Documents\Astra Try\x64\Debug\Plugins\;C:\Users\f002sxf\Documents\Astra Try\x64\Debug\
2019-08-12 20:12:14,685 DEBUG [plugin_manager] load plugins
2019-08-12 20:12:14,685 DEBUG [plugin_manager] try_load_plugin C:\Users\f002sxf\Documents\Astra Try\x64\Debug\Plugins\openni_sensor.dll
2019-08-12 20:12:14,724 DEBUG [plugin_manager] try_load_plugin valid plugin
2019-08-12 20:12:14,724 INFO [plugin_manager] loading plugin: C:\Users\f002sxf\Documents\Astra Try\x64\Debug\Plugins\openni_sensor.dll version: v2.0.16-e6b4f7afb2 API level: 1
2019-08-12 20:12:14,724 INFO [orbbec.ni.WmfBackend] Initializing Media Foundation
2019-08-12 20:12:14,739 INFO [orbbec.ni.oni_adapter_plugin] Initializing OpenNI v2.3.0.57
2019-08-12 20:12:14,925 INFO [orbbec.ni.oni_adapter_plugin] Initialized OpenNI v2.3.0.57
2019-08-12 20:12:14,925 DEBUG [plugin_manager] try_load_plugin initialized plugin
2019-08-12 20:12:14,925 DEBUG [plugin_manager] try_load_plugin C:\Users\f002sxf\Documents\Astra Try\x64\Debug\Plugins\OrbbecBodyTracking.dll
2019-08-12 20:12:14,947 DEBUG [plugin_manager] try_load_plugin valid plugin
2019-08-12 20:12:14,947 INFO [plugin_manager] loading plugin: C:\Users\f002sxf\Documents\Astra Try\x64\Debug\Plugins\OrbbecBodyTracking.dll version: v2.0.16-e6b4f7afb2 API level: 1
2019-08-12 20:12:15,167 DEBUG [plugin_manager] try_load_plugin initialized plugin
2019-08-12 20:12:15,167 DEBUG [plugin_manager] try_load_plugin C:\Users\f002sxf\Documents\Astra Try\x64\Debug\Plugins\orbbec_hand.dll
2019-08-12 20:12:15,178 DEBUG [plugin_manager] try_load_plugin valid plugin
2019-08-12 20:12:15,178 INFO [plugin_manager] loading plugin: C:\Users\f002sxf\Documents\Astra Try\x64\Debug\Plugins\orbbec_hand.dll version: v2.0.16-e6b4f7afb2 API level: 1
2019-08-12 20:12:15,179 DEBUG [plugin_manager] try_load_plugin initialized plugin
2019-08-12 20:12:15,179 DEBUG [plugin_manager] try_load_plugin C:\Users\f002sxf\Documents\Astra Try\x64\Debug\Plugins\orbbec_xs.dll
2019-08-12 20:12:15,180 DEBUG [plugin_manager] try_load_plugin valid plugin
2019-08-12 20:12:15,180 INFO [plugin_manager] loading plugin: C:\Users\f002sxf\Documents\Astra Try\x64\Debug\Plugins\orbbec_xs.dll version: v2.0.16-e6b4f7afb2 API level: 1
2019-08-12 20:12:15,181 INFO [astra.xs.plugin] Initializing xs plugin
2019-08-12 20:12:15,181 DEBUG [plugin_manager] try_load_plugin initialized plugin
2019-08-12 20:12:15,181 INFO [context] client opening streamset: device/default
2019-08-12 20:12:15,181 INFO [streamset_catalog] default uri provided.
2019-08-12 20:12:15,181 INFO [astra.streamset] connecting to (1,0) on device/sensor0
2019-08-12 20:12:15,181 DEBUG [astra.streamset] registering stream (1, 0) on device/sensor0
2019-08-12 20:12:15,181 DEBUG [astra.stream_connection] 000002460E4DF8F0 starting (1, 0)