Arianna
Arianna

Reputation: 1

Pylon Camera Emulator Issue: No device is available

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

Answers (1)

Arianna
Arianna

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

Related Questions