0

Good morning,

I´m trying to load a camera configuration file (.ini) with the following function:

pParam="config.ini" 
ueye.is_ParameterSet(hCam, ueye.IS_PARAMETERSET_CMD_LOAD_FILE, pParam, 0)

But I get this error:

File "E:/Proyectos/PruebaIDS/FreerunMode.py", line 55, in <module> ueye.is_ParameterSet(hCam, ueye.IS_PARAMETERSET_CMD_LOAD_FILE, pParam, 0) 
File "E:\Proyectos\PruebaIDS\venv\lib\site-packages\pyueye\ueye.py", line 8271, in is_ParameterSet _pParam = _pointer_cast(pParam, ctypes.c_void_p) 
File "E:\Proyectos\PruebaIDS\venv\lib\site-packages\pyueye\ueye.py", line 102, in _pointer_cast _to_obj = ctypes.cast(ctypes.pointer(from_obj), to_type) TypeError: _type_ must have storage info

Am I passing the right parameters to the function?

skillsmuggler
  • 1,862
  • 1
  • 11
  • 16
binflo13
  • 1
  • 3
  • Shouldn't you be able to call the `UEyeCamDriver::loadCamConfig` function somehow? Because the load function uses this `is_ParameterSet` call internally. – Gábor Fekete Jun 05 '19 at 13:51
  • I do not see any Pyueye function that refers to the loadCamConfig function you mentioned. – binflo13 Jun 05 '19 at 14:27
  • oh then maybe there is no wrapper for this in python, I could only find [this](http://docs.ros.org/jade/api/ueye_cam/html/ueye__cam__driver_8cpp_source.html) C++ code for the function you are trying to use. – Gábor Fekete Jun 05 '19 at 14:33
  • According to IDS, [this](https://es.ids-imaging.com/manuals/uEye_SDK/EN/uEye_Manual_4.92/index.html) is the function tou use , but I don´t know how to adapt the parameters – binflo13 Jun 05 '19 at 14:54

1 Answers1

1

This function needs a wchar_t*, so you must first create a python object of it and then set its value. Here is how to:

pParam = ueye.wchar_p()
pParam.value = "config.ini"

ueye.is_ParameterSet(hCam, ueye.IS_PARAMETERSET_CMD_LOAD_FILE, pParam, 0)
Hibbel
  • 133
  • 8
  • It works! How did you know the parameter type the function needed? – binflo13 Jun 12 '19 at 13:24
  • I work at IDS :) Also, you can have a look at the C interface documentation for is_ParameterSet. In the example section you can see the usage of the wide string literal: L"C:\path\...". Therefore you need to use wchar_t – Hibbel Jun 14 '19 at 09:05
  • @Hibbel how can I load and set the parameters in Python. The function is working but the parameters are not set – Aitul Jul 17 '19 at 12:56
  • I'm not sure what you mean. This might help:If you use the load command you load the parameters from the file to the cameras. If you want to change the content of the ini file you can either do that by changing it manually or by changing the value using the corresponding function and then save the file using IS_PARAMETERSET_CMD_SAVE_FILE. – Hibbel Jul 19 '19 at 05:29