In the above code, the first cam.start_live_video() works fine, the second one throws an error
UC480Error Traceback (most recent call last)
Cell In [1], line 18
15 cam.open()
16 cam.is_open
---> 18 cam.start_live_video()
File <decorator-gen-2>:2, in start_live_video(self, framerate, **kwds)
File ~\Anaconda3\envs\COVEQ-v08-TSI\lib\site-packages\instrumental\drivers\util.py:342, in _unit_decorator.<locals>.wrap.<locals>.wrapper(func, *args, **kwargs)
339 if name not in new_kwargs:
340 new_kwargs[name] = new_defaults[name]
--> 342 result = func(*new_args, **new_kwargs)
344 # Allow for unit checking of multiple return values
345 if isinstance(ret_units, tuple):
File ~\Anaconda3\envs\COVEQ-v08-TSI\lib\site-packages\instrumental\drivers\cameras\uc480.py:881, in UC480_Camera.start_live_video(self, framerate, **kwds)
878 self._set_exposure(kwds['exposure_time'])
879 self._set_gain(kwds['gain'])
--> 881 self._free_image_mem_seq()
882 self._allocate_mem_seq(num_bufs=2)
883 self._set_queueing(False)
File ~\Anaconda3\envs\COVEQ-v08-TSI\lib\site-packages\instrumental\drivers\cameras\uc480.py:719, in UC480_Camera._free_image_mem_seq(self)
717 self._dev.ClearSequence()
718 for buf in self._buffers:
--> 719 self._dev.FreeImageMem(buf.ptr, buf.id)
720 self._buffers = []
File ~\Anaconda3\envs\COVEQ-v08-TSI\lib\site-packages\nicelib\nicelib.py:701, in LibMethod.__call__(self, *args, **kwds)
699 if self._libfunc.sig.flags.get('use_handle', True):
700 args = self._niceobj._handles + args
--> 701 return self._libfunc._call(args, kwds, niceobj=self._niceobj)
File ~\Anaconda3\envs\COVEQ-v08-TSI\lib\site-packages\nicelib\nicelib.py:1171, in LibFunction._call(self, args, kwds, niceobj)
1164 retval = self.c_func(*c_args)
1166 ret_handler_args = {
1167 'niceobj': niceobj,
1168 'funcname': self.name,
1169 'funcargs': c_args,
1170 }
-> 1171 return self.sig.extract_outputs(c_args, retval, ret_handler_args)
File ~\Anaconda3\envs\COVEQ-v08-TSI\lib\site-packages\nicelib\nicelib.py:219, in Sig.extract_outputs(self, c_args, retval, ret_handler_kwargs)
214 out_vals = [handler.extract_output(self.ffi, c_arg)
215 for handler, c_arg in zip(self.handlers, c_args)
216 if handler.makes_output]
218 if self.ret_handler:
--> 219 retval = self.ret_handler.handle(retval, ret_handler_kwargs)
221 if retval is not None:
222 out_vals.append(retval)
File ~\Anaconda3\envs\COVEQ-v08-TSI\lib\site-packages\nicelib\nicelib.py:543, in RetHandler.handle(self, retval, available_kwargs)
540 except KeyError as e:
541 raise KeyError("Unknown arg '{}' in arglist of ret-handling function "
542 "'{}'".format(e.args[0], self.__name__))
--> 543 return self.__func__(retval, **kwargs)
File ~\Anaconda3\envs\COVEQ-v08-TSI\lib\site-packages\instrumental\drivers\cameras\uc480.py:110, in ret_cam_errcheck(result, niceobj)
107 @RetHandler(num_retvals=0)
108 def ret_cam_errcheck(result, niceobj):
109 if result != NiceUC480.SUCCESS:
--> 110 raise get_last_error(result, niceobj)
UC480Error: (-1) b'An unspecified error occurred'
Changing the reopen_policy doesn't seem to matter.
Am I doing something wrong here?
I would really like to be able to close(), in order to be able run the normal ThorCam software from time to time.
In the above code, the first
cam.start_live_video()
works fine, the second one throws an errorChanging the
reopen_policy
doesn't seem to matter. Am I doing something wrong here? I would really like to be able toclose()
, in order to be able run the normal ThorCam software from time to time.