Reputation: 1
I'm trying to use Pylon to emulate a camera. I've used the 'Pylon_with_OpenCV.cpp' code provided by Basler which should enable me to acquire and display images.
However, when I run my ROS node, it runs without errors but my emulated camera isn't recognised. I get the following message: An exception has occurred. 'No device is available or no device contains the provided device info properties.'
I set the environment variable by doing export PYLON_CAMEMU=1
then running roscore
in the same window, as instructed, so I'm not sure if there's anything else I need to add to my code or other steps I need to take to set up the emulated camera.
The emulated camera seems to work when I open pylon Viewer but not using pylon API.
Any help is much appreciated!
Upvotes: 0
Views: 622
Reputation: 1
I have solved it :) I had to add:
#include <cstdlib>
And within my function add:
char env[] = "PYLON_CAMEMU=1";
putenv(env);
Upvotes: 0