Closed bruno-darochac closed 1 year ago
Hi @bruno-darochac ,
We apologize for the incorrect requirements, it should be depthai==1.0.0.0
. Could you try installing that first?
Thanks, Erik
Hello thanks for your fast answer !
It works for the installation and the running, but know when your program draw a rectangle on the image it crashed with this output
Traceback (most recent call last):
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/main.py", line 121, in <module>
MainDebug().run()
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/main.py", line 34, in run
self.parse_frame(frame, results)
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/main.py", line 92, in parse_frame
super().parse_frame(frame, results)
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/main.py", line 26, in parse_frame
crash_alert = self.crash_avoidance.parse(tracker_objs)
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/crash_avoidance.py", line 81, in parse
if len(self.entries[key]) > 2 and self.is_dangerous_trajectory(key) and self.is_impact_close(key):
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/crash_avoidance.py", line 29, in is_dangerous_trajectory
m, b = self.best_fit_slope_and_intercept(objectID)
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/crash_avoidance.py", line 23, in best_fit_slope_and_intercept
m, b = np.polyfit(xs, zs, 1)
File "<__array_function__ internals>", line 200, in polyfit
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/venv/lib/python3.10/site-packages/numpy/lib/polynomial.py", line 668, in polyfit
c, resids, rank, s = lstsq(lhs, rhs, rcond)
File "<__array_function__ internals>", line 200, in lstsq
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/venv/lib/python3.10/site-packages/numpy/linalg/linalg.py", line 2285, in lstsq
x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/venv/lib/python3.10/site-packages/numpy/linalg/linalg.py", line 101, in _raise_linalgerror_lstsq
raise LinAlgError("SVD did not converge in Linear Least Squares")
numpy.linalg.LinAlgError: SVD did not converge in Linear Least Squares
Here are the version of opencv and numpy that I have on my venv numpy==1.24.2 opencv-python==4.7.0.72
Should I have other one ? Thanks in advance
Hi @bruno-darochac , I'd suggest using these requirements, and for numpy I would take the latest that was released back then (2 years ago). Thoughts? Thanks, Erik
Hello, this allow me to launch the program.
But I have to comportement now,
/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/venv/lib/python3.10/site-packages/numpy/lib/polynomial.py:667: RuntimeWarning: invalid value encountered in divide
lhs /= scale
** On entry to DLASCL parameter number 4 had an illegal value
** On entry to DLASCL parameter number 4 had an illegal value
** On entry to DLASCL parameter number 4 had an illegal value
** On entry to DLASCL parameter number 4 had an illegal value
** On entry to DLASCL parameter number 5 had an illegal value
** On entry to DLASCL parameter number 4 had an illegal value
=== New data in observer stream host_capture, size: 4
Writing 4 bytes to host_capture
!!! XLink write successful: host_capture (4)
Stopping threads: ...
E: [global] [ 843163] [EventRead00Thr] handleIncomingEvent:563 handleIncomingEvent() Read failed -4
E: [global] [ 843164] [python3] addEvent:262 Condition failed: event->header.flags.bitField.ack != 1 E: [global] [ 843164] [python3] addEventWithPerf:276 addEvent(event) method call failed with an error: 3 E: [global] [ 843164] [python3] XLinkReadData:156 Condition failed: (addEventWithPerf(&event, &opTime)) Device get data failed: 7 Closing stream metaout: ... E: [global] [ 843164] [python3] addEvent:262 Condition failed: event->header.flags.bitField.ack != 1 E: [global] [ 843164] [python3] addEventWithPerf:276 addEvent(event) method call failed with an error: 3 E: [global] [ 843164] [python3] XLinkReadData:156 Condition failed: (addEventWithPerf(&event, &opTime)) Device get data failed: 7 Closing stream previewout: ... E: [global] [ 843164] [Scheduler00Thr] dispatcherEventSend:53 Write failed (header) (err -4) | event XLINK_CLOSE_STREAM_REQ
Closing stream metaout: DONE. Thread for metaout finished. E: [xLink] [ 843164] [Scheduler00Thr] sendEvents:1027 Event sending failed E: [global] [ 843164] [Scheduler00Thr] dispatcherEventSend:53 Write failed (header) (err -4) | event XLINK_CLOSE_STREAM_REQ
E: [xLink] [ 843164] [Scheduler00Thr] sendEvents:1027 Event sending failed Closing stream previewout: DONE. Thread for previewout finished. Stopping threads: DONE 0.042s. Closing all observer streams: ... Closing stream host_capture: ... Closing stream host_capture: DONE. Closing all observer streams: DONE. Reseting device: 0. E: [global] [ 843164] [Scheduler00Thr] dispatcherEventSend:53 Write failed (header) (err -4) | event XLINK_RESET_REQ
E: [xLink] [ 843164] [Scheduler00Thr] sendEvents:1027 Event sending failed E: [xLink] [ 843165] [python3] DispatcherWaitEventComplete:367 Assertion Failed: curr != NULL
E: [global] [ 843165] [python3] XLinkResetRemote:254 Condition failed: DispatcherWaitEventComplete(&link->deviceHandle)
Reseting: DONE.
2023-03-07 10:37:23,165 - depthai_utils - INFO - [INFO] elapsed time: 2.19
2023-03-07 10:37:23,173 - depthai_utils - INFO - [INFO] approx. FPS: 24.64
Traceback (most recent call last):
File "/home/bruno/dev/FIAT/RIP_CSEM/depthai-experiments/collision-avoidance/main.py", line 121, in
2. And the second is that if nothing is in front it will crash the same way as before when someting pass in front of the camera..
Hi @bruno-darochac , This API and demo have been deprecated for 2 years now, and we will not be fixing them. For collision avoidance, I would suggest using ROS, where such tasks are already "solved". Thanks, Erik
Hi @Erol444 ,
Thank you for your suggestion. I'm curious that the ROS you mention is to use ROS standard API, or use depthai-ros repository ? I can't found a collision avoidance demo in depthai-ros repository, can you point out where I can find it in Luxonis's repositories.
Thanks in advance !
Br, Michael
Hi @michaelnguyen11 , I was referring to ROS itself, I believe there should be quite a few opensource projects/demos doing collision avoidance inside ros (based on pointclouds). Thanks, Erik
Hello ! I would like to test your collision avoidance. I know that it is always on a gen1 implementation. I see in an other issue that just installing the requirements should make the code work, but I see no spcification of version in the requirements :
Here is the error message i got :
It appear when trying to initialise the device on depthai_utils.py
Is it always runnable ? And if yes is it fixable ?
Thanks in advance for your answer