Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about function PylonInitialize #199

Closed
Felix00643298 opened this issue Jan 22, 2024 · 6 comments
Closed

Question about function PylonInitialize #199

Felix00643298 opened this issue Jan 22, 2024 · 6 comments

Comments

@Felix00643298
Copy link

Felix00643298 commented Jan 22, 2024

Hey,
I am wondering if I have 2 basler cameras, can I call PylonInitialize twice in each individual basler camera object in 2 seperate threads?
Thanks.

@m-binev
Copy link

m-binev commented Jan 22, 2024

Hi @Felix00643298, well PylonInitialize() ist loading the complete pylon runtime environment for the given application and should be called ideally only once.
For more information you may also refer to: https://docs.baslerweb.com/pylonapi/cpp/pylon_programmingguide#initializationuninitialization-of-the-pylon-runtime-library

@Felix00643298
Copy link
Author

Hi @Felix00643298, well PylonInitialize() ist loading the complete pylon runtime environment for the given application and should be called ideally only once. For more information you may also refer to: https://docs.baslerweb.com/pylonapi/cpp/pylon_programmingguide#initializationuninitialization-of-the-pylon-runtime-library

In my ROS system, there are multiple Basler cameras, and I initialize each camera sequentially using ROS plugins. This is a multi-threaded system, and currently, I call PylonInitialize once in the constructor of each Basler class. However, it seems to make the program very unstable, and I'm unsure if what I'm doing is incorrect.

basler::basler()
{
    PylonInitialize();
}
basler::~basler()
{
    PylonTerminate();
}

@FrancoisPicardDTI
Copy link
Collaborator

Hello @Felix00643298
Do you use at all the ROS Basler driver in your setup? You can call one driver instance per camera.

@Felix00643298
Copy link
Author

Hello @Felix00643298 Do you use at all the ROS Basler driver in your setup? You can call one driver instance per camera.

Thanks for replying me.
Do you mean using one dirver instance to init all basler camera and make sure PylonInitialize is only called once?

@FrancoisPicardDTI
Copy link
Collaborator

Hello @Felix00643298
You are posting here an issue that should be related to the ROS pylon driver: https://github.com/basler/pylon-ros-camera
Are you using this driver to operate your cameras? Otherwise, you need to contact Basler support I guess.

Looking at your issue, it should not be a problem to call in several instances PylonInitialize. Can you explain a bit more what you are trying to do ? and eventually provide with code examples so that your issue can be reproduced ? You are writing that your program is very unstable, can you be more specific and provide with error messages ?

@FrancoisPicardDTI
Copy link
Collaborator

I am closing the issue for now, as there's no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants