I’m having problems running samples from the latest commit in the Astra GitHub repository. I’ve posted an issue in the Astrak SDK repository here. I’m cross posting this here as I realized that repo doesn’t seem to be actively maintained.
https://github.com/orbbec/astra/issues/38
I'm trying to run from the recommended Astra SDK building from the GitHub repository. Everything I try results in:
`assert(parameterBinHandle != nullptr);`
Setup:
```
Mac OSX 10.12.2
Xcode 8.3.3
```
```
commit: https://github.com/orbbec/astra/commit/22639dff325c90488f17de2483bab9c65ceace51
```
```
cmake -H. -B_builds/xcode -GXcode -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=_install/xcode
cmake --build _builds/xcode --config Debug --target install --
open _builds/xcode/
```
Using the default install path here:
> set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/sdk")
When I run `DepthReaderEventCPP`, for example., it reports:
```
depthStream -- hFov: Assertion failed: (parameterBinHandle != nullptr), function get_parameter, file /tmp/astra/src/astra_core/astra_stream_connection.cpp, line 197.
```
![astra_parameterbinhandle](https://user-images.githubusercontent.com/554720/39398213-c9dabc0a-4ad8-11e8-9a89-83407b7c1f63.jpg)
From what I can tell, this is due to `is_available()` always returning `false`.
```
void stream::get_parameter(stream_connection* connection,
astra_parameter_id id,
astra_parameter_bin_t& parameterBin)
{
if (is_available()) // <=== HERE
on_get_parameter(connection, id, parameterBin);
}
```
Where `is_avaialble()` is defined as:
```
bool stream_backend::is_available() { return callbacks_ != nullptr; }
```
When I run the applications, the `callbacks_` member is never assigned.
The only place the `callbacks_` member is assigned is here:
```
void stream_backend::set_callbacks(const stream_callbacks_t& callbacks)
{
callbacks_ = astra::make_unique<stream_callbacks_t>(callbacks);
on_availability_changed();
}
```
If I search for `set_callbacks()` to see where this can occur, I find:
```
void streamset::claim_stream(stream* stream, stream_callbacks_t callbacks)
```
```
astra_status_t plugin_service_impl::register_stream(astra_stream_t handle, stream_callbacks_t pluginCallbacks)
```
Neither of these are getting called. Can someone provide any pointers for this?
UPDATE: An internal `dlopen()` call couldn't find `libOpenNI2.dylib` and the error wasn't reported. Adding `export DYLD_LIBRARY_PATH=${PWD}/_builds/xcode/lib/Plugins/openni2/:${DYLD_LIBRARY_PATH}` (or equivalent RPATH handling) fixes it.