I've been trying to create a custom script that allows me to turn on/off an OAK-D Pro W PoE camera in various modes (RGB, depth etc). However, when I run the camera once (say have it capture 10 depth frames) and then run rgb mode it throws an error upon trying to restart the pipeline the second time:
Stack trace (most recent call last):
#30 Object "", at 00007FFF1D2B257D, in BaseThreadInitThunk
Attempt to access invalid address.
#29 Object "", at 00007FF7A7081268, in ??
#28 Object "", at 00007FFE95F4BFD9, in Py_Main
#27 Object "", at 00007FFE95F4C023, in Py_Main
#26 Object "", at 00007FFE95FD1001, in Py_RunMain
#25 Object "", at 00007FFE95FD1178, in Py_RunMain
#24 Object "", at 00007FFE95FACB32, in Py_MakePendingCalls
#23 Object "", at 00007FFE95FAD100, in PyRun_AnyFileExFlags
#22 Object "", at 00007FFE95FAD2D3, in PyRun_SimpleFileExFlags
#21 Object "", at 00007FFE95F4BF10, in Py_stat
#20 Object "", at 00007FFE95F4BAB7, in PyUnicode_CompareWithASCIIString
#19 Object "", at 00007FFE95F616BE, in PyFuture_FromASTObject
#18 Object "", at 00007FFE95F6173E, in PyFuture_FromASTObject
#17 Object "", at 00007FFE95F61A1D, in PyEval_EvalCode
#16 Object "", at 00007FFE95F61ABF, in PyEval_EvalCodeEx
#15 Object "", at 00007FFE95F6C929, in PyEval_EvalCodeWithName
#14 Object "", at 00007FFE95F27AD6, in PyFunction_Vectorcall
#13 Object "", at 00007FFE95F2DE62, in PyEval_EvalFrameDefault
#12 Object "", at 00007FFE95F2595C, in Py_NewReference
#11 Object "", at 00007FFE95F27AD6, in PyFunction_Vectorcall
#10 Object "", at 00007FFE95F2E28B, in PyEval_EvalFrameDefault
#9 Object "", at 00007FFE95F252F4, in Py_NewReference
#8 Object "", at 00007FFE96073F3B, in PyErr_FormatFromCauseTstate
#7 Object "", at 00007FFE95F19B3D, in PyObject_MakeTpCall
#6 Object "", at 00007FFE95F8F0EE, in PyArg_ParseTuple_SizeT
#5 Object "", at 00007FFE4319AAA1, in pybind11::error_already_set::error_already_set
#4 Object "", at 00007FFE431FA5B4, in PyInit_depthai
#3 Object "", at 00007FFE431FA500, in PyInit_depthai
#2 Object "", at 00007FFE43401E3D, in PyInit_depthai
#1 Object "", at 00007FFE433CF0EE, in PyInit_depthai
#0 Object "", at 00007FFE433CF40A, in PyInit_depthai
I suspect this is due to streams not being properly closed out upon the first run but I'm not sure if this is the case or how to do so. Can someone point me to the correct code that handles this? Thanks!