Hmm it could be that the API changed a bit in the SDK since the addon was written.
I would maybe try running their sample code in your ofApp::setup and see if that has the same error.
Leave the addon included in your ofApp.h but comment out the usage of it and try their example from this page: CPP API Manual — Vimba Developer Guide 6.1 documentation
If you get a "Camera opened" that means it is getting further in the process than the addon is and maybe something needs to be fixed in the addon API usage.
Thanks Theo, I’m pretty sure I installed correctly, and the Vimba SKD version is 6.0 which matches the addon repo tested version. I tried with an older version of OF 0.11.2 to match the tested addon also and 32 and 64bit builds.
In the process I found the 64bit build works if I start the app/build without the camera connected and once started then connect the camera it is detected and image feed starts up.
Doesn’t work if camera is connected during startup, disconnected and reconnected.
I’m now trying to find in the code what’s causing this issue.
The code runs to line 27 of Discovery::start() in addons\ofxVimba\libs\OosVim\src\Discovery.cpp
with a notice of “Listening for camera to connect”.
If camera is then connected the camera is detected and image feed windows opens.
I’d like it to run without needing to start app with the camera disconnected.
Any ideas would be much appreciated.
I’ve tried a delay before calling grabber.setup(ofGetWindowWidth(), ofGetWindowHeight(), true); in ofApp::setup which didn’t help.
With a slight adjustment the sample code from Vimba SDK docs ran OK in setup as you suggested, so I will also look into further into that.
AVT::VmbAPI::CameraPtrVector cameras;
AVT::VmbAPI::VimbaSystem& system = AVT::VmbAPI::VimbaSystem::GetInstance();
if (VmbErrorSuccess == system.Startup())
{
if (VmbErrorSuccess == system.GetCameras(cameras))
{
for (AVT::VmbAPI::CameraPtrVector::iterator iter = cameras.begin();
cameras.end() != iter;
++iter)
{
if (VmbErrorSuccess == (*iter)->Open(VmbAccessModeFull))
{
std::cout << "Camera opened" << std::endl;
}
}
}
}
Hmm, my guess is that there might be something in the addon wrapper that is creating a race condition between the addon thinking things are ready and the Vimba SDK being ready.
You could mess around with putting some ofSleepMillis(500); calls in between different lines of ofApp.cpp and see if that has any affect?