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

FLIR GEV crash in _retrieve_file_path #441

Open
4 of 6 tasks
enp6s0 opened this issue Jan 12, 2024 · 1 comment
Open
4 of 6 tasks

FLIR GEV crash in _retrieve_file_path #441

enp6s0 opened this issue Jan 12, 2024 · 1 comment

Comments

@enp6s0
Copy link

enp6s0 commented Jan 12, 2024

Describe the Issue
Cannot create acquirer with FLIR GEV cameras, apparently due to an option parsing error

To Reproduce
Steps to reproduce the behavior:

  1. Try to create an acquirer using the following code with FLIR GigE vision cameras

Sample Code
I can show a piece of code that demonstrates the reported phenomenon:

  • Yes
  • No
# Simplified version
h = Harvester()
h.add_file(cti) # cti points to actual GenTL producer under /opt/spinnaker
h.update()

acquirer = h.create({"serial_number" : "xxx"}) # seems to fail here
acquirer.start()

Traceback

Traceback (most recent call last):
  File "/work/gev.py", line 123, in __init__
    self.acquirer = self.harvester.create({"serial_number" : cam_serial})
  File "/usr/local/lib/python3.10/dist-packages/harvesters/core.py", line 3085, in create
    return self._create_acquirer(device_proxy=device_proxy, config=config)
  File "/usr/local/lib/python3.10/dist-packages/harvesters/core.py", line 3115, in _create_acquirer
    ia = ImageAcquirer(device_proxy=device_proxy_, config=config,
  File "/usr/local/lib/python3.10/dist-packages/harvesters/core.py", line 1632, in __init__
    self._remote_device = RemoteDevice(
  File "/usr/local/lib/python3.10/dist-packages/harvesters/core.py", line 486, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/dist-packages/harvesters/core.py", line 281, in __init__
    self.node_map = self._create_node_map(
  File "/usr/local/lib/python3.10/dist-packages/harvesters/core.py", line 320, in _create_node_map
    clean_up_required, file_path = self._retrieve_file_path(
  File "/usr/local/lib/python3.10/dist-packages/harvesters/core.py", line 390, in _retrieve_file_path
    file_name, address, size = others.split(';')
ValueError: too many values to unpack (expected 3)

I've tried dumping out others, and it seems that the offending input is:

GRS_GEV_v003_189150.zip;7F1D0040;7959GRS_GEV_v003_181950.zip;7F1D0040;7959

Other inputs seems fine:

SFNC_GenTLSystem_Version_1_0_0_Schema_1_1.xml;42c1d80;74a3
SFNC_GenTLInterface_GigE_Version_1_0_0_Schema_1_1.xml;42c1d80;d58a
SFNC_GenTLInterface_GigE_Version_1_0_0_Schema_1_1.xml;42c1d80;d58a
SFNC_GenTLInterface_GigE_Version_1_0_0_Schema_1_1.xml;42c1d80;d58a
SFNC_GenTLInterface_GigE_Version_1_0_0_Schema_1_1.xml;42c1d80;d58a
SFNC_GenTLInterface_Usb3_Version_1_0_0_Schema_1_1.xml;42c1d80;6867

Expected Behavior
Harvesters should be able to connect to the camera and get image frames

Configuration

Reproducibility

This phenomenon can be stably reproduced:

  • Yes
  • No.

Actions You Have Taken

  • I've read the Harvester FAQ page.
  • Dumping the others variable (see above) seems to reveal an offending input that contributed to the crash
@enp6s0
Copy link
Author

enp6s0 commented Jan 21, 2024

As a workaround, I patched the parser to disregard extra parameters and trim the size variable... a hacky solution but it does work:

try:
    file_name, address, size = others.split(';')
except ValueError:
    splitted = others.split(';')
    file_name = splitted[0]
    address = splitted[1]
    size = splitted[2][:4]

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

1 participant