SwapnilBhole I am working on motion detection project. If motion is detected, then hardware pin should generate interrupt or it should send string on serial. Is there any examples for this? I have OAK-D-Pro-POE kit.
jakaskerl Hi SwapnilBhole M8 has two pins that i believe are programmable. https://docs.luxonis.com/projects/hardware/en/latest/pages/NG9097pro/#connectors PIN1 - aux, script on how to read write -alex-luxonis/depthai-python400b6e0 PIN5 - GPIO9 Additionally the VBUSIN pin (M8 pin 5) can be programmed to output 5V (the feature of providing power to the connected accessory device), by driving GPIO 9 as output high. Depending on the application, this may serve as an output indicator by toggling it output high/low (but for low you may need to add a pull-down resistor to GND to discharge the residual voltage). Added some code here: alex-luxonis/depthai-python0434a97 VBUS_OUT_GPIO_CTRL = 9 GPIO.setup(VBUS_OUT_GPIO_CTRL, GPIO.OUT, GPIO.PULL_NONE) GPIO.write(VBUS_OUT_GPIO_CTRL, 1) # Enable 5V output UART example: https://docs.luxonis.com/projects/api/en/latest/samples/Script/script_uart/ - out of the box for 4P only Thanks, Jaka
jakaskerl Hi SwapnilBhole There are examples for the SDK with triggers. https://docs.luxonis.com/projects/sdk/en/latest/features/conditional-actions/ I think you should be able to create a new action that sets the GPIO when trigger is activated. Afaik there are no examples for the API at the time. Thanks, Jaka
jakaskerl Hi SwapnilBhole Works fine on my side. Make sure to also update the depthai_sdk python package. Thanks, Jaka
erik Hi SwapnilBhole , I don't think the SDK is actually the best path to take for this. For motion detection - is that motion of some object in the view, or camera motion? For object motion, you could look into: https://github.com/luxonis/depthai-experiments/tree/master/gen2-custom-models#difference-between-2-frames Feature Tracker - eg. if any feature on the frame moves by more than 0.2 (so 20% of the frame), there was some motion For camera motion: IMU, look at accelerometer, demo here Feature tracker (same as above), if camera is moving, all/most features on the frame should move around. Thoughts on these approaches?
SwapnilBhole Hi @erik is that motion of some object in the view, or camera motion? =? : Object I will try above links & will update
SwapnilBhole Hi @jakaskerl : I have run example code & recordings are getting save. I am new in programming. once person is detected, I have to make GPIO high for few millisecond or print "capture" string on console. Can you guide for this?
erik @SwapnilBhole Motion of some object in the view of the camera. Please use chatGpt (gpt4) for general programming questions, as it's much much faster and more accurate. Thanks, Erik