Dear all,
Currently I am experiencing an issue with the use of astra sdk on the android system. After downloading the latest ASTRA SDK 2.0.15 FOR ANDROID from Developers - ORBBEC - 3D Vision for a 3D World, I try to use the interface to get depth data and color data, the code is as follows.
final AstraAndroidContext aac = new AstraAndroidContext(getApplicationContext());
try {
aac.initialize();
aac.openAllDevices();
StreamSet streamSet = StreamSet.open();
StreamReader reader = streamSet.createReader();
reader.addFrameListener(new StreamReader.FrameListener() {
public void onFrameReady(StreamReader reader, ReaderFrame frame) {
Log.d("FRAME", "frame arrive");
}
});
// PointStream pointStream = PointStream.get(reader);
// pointStream.start();
DepthStream depthStream = DepthStream.get(reader);
depthStream.start();
while (true) {
Astra.update();
TimeUnit.MILLISECONDS.sleep(3000);
}
// pointStream.stop();
depthStream.stop();
streamSet.close();
} catch (Throwable e) {
Log.e("ASTRA", e.toString());
} finally {
aac.terminate();
}
The runtime SDK throws a java.lang.UnsupportedOperationException: Invalid operation exception, and the debug finds an exception when executing DepthStream depthStream = DepthStream.get(reader);
If I get the point data (that is, the PointStream part of the code and comment out the DepthStream part), no exception is thrown, and the point data can be obtained normally.
PS: The case of getting color data is the same as the depth data, and an exception is thrown.
I am grateful to anyone who offers help, about how to get the right color and depth data.
Best regards.