-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protect LineFollower from None cam_img #961
Comments
It looks like the picam already handles it's own warming; perhaps it should wait until frames get returned. donkeycar/donkeycar/parts/camera.py Line 35 in 3297771
|
Calling the run() method on the camera part does NOT set self.frame. It should probably set self.frame and return that if it does not get a frame from the camera. That's not the issue here, but probably still a good idea. Then we can call the run method until a non-empty frame is returned and then we know positively that the camera is warmed OR if we do this for 2 seconds and do not get a frame then we know the camera is not going to work. Then when enter the vehicle loop the camera part will already have one frame ready. |
https://github.com/autorope/donkeycar/tree/961-protect-from-empty-camera-image
|
I get a related bug using the complete.py template from dev branch and a model that uses 'CROP' transformation. In that case it appears that imgaug get's a None image and becomes unhappy
If I remove 'CROP' transformation then the model runs without the error (of course it does not perform well) So that shows it is the imgaug that is erroring. |
I was able to repeat the cv_control bug using the current dev branch (commit a26bb73) . I then switch the donkeycar project folder to the fix branch, https://github.com/autorope/donkeycar/tree/961-protect-from-empty-camera-image and the error went array. So this confirms that the issue was with a None image and the fix branch fixes that. I need to test with CISC camera and Web cam as well. |
Got the imgaug error on a Jetson Nano with CSIC camera config trying to run a model that uses 'CROP' configuration using the complete.py template and the dev branch;
|
Pull Request 967 addresses this issue and a little more. |
We are unable to test 'CROP' with CSIC camera on the Jetson Nano because of a bug in imgaug on the Jetson Nano; see Issue 970. We can verify that the CSIC camera passes the warm up phase and returns frames. So the 'CROP' code would work if imgaug worked and given we have confirmed 'CROP' works on RaspberryPi with PICAM and we have not actually changed any 'CROP' code, then we can presume that it would work on the Nano if imgaug is fixed. |
Merged #967 |
User anbello is getting an error trying to start the cv_control template.:
My theory is that when the template first starts, the camera is not 'warmed' so it doesn't immediately return an image, which causes the LineFollower to fail. We should 1) warm the camera (wait until it starts providing frames) 2) protect LineFollower from a None image by just returning.
donkeycar/donkeycar/templates/cv_control.py
Line 80 in 3297771
Discovered bug: cv_control.py will not run on a headless OS install because it tries to open a window with debug info using opencv. The fix is to make this debug window optional.
Tasks
Testing
Note: these tests require installation of 'imgaug' on the donkeycar, which is an optional install
pip install imgaug
reproduce newly found bug in 'CROP' image transform configuration in complete.py dev branch (commit a26bb73) on Raspberry Pi with 'PICAM' camera
reproduce 'CROP' transform bug in dev branch (commit a26bb73) on Jetons Nano 2GB with 'CSIC' camera configuration
verify complete.py 'CROP' transform bug cannot be repeated using fix branch and PICAM camera on Raspbery Pi
verify complete.py 'CROP' transform bug cannot be repeated using fix branch and CSIC camera on Jetson Nano
verify complete.py 'CROP' transform bug cannot be repeated using fix branch and WEBCAM camera (not requires optional install of pygame;
sudo apt-get install libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 libsdl2-2.0-0
,pip install pygame
Verify that cv_control.py template can run without debug window on headless OS. Tested on Raspberry Pi with PICAM configuration and headless Raspberry Pi OS (tested via ssh without HDMI connected)
The text was updated successfully, but these errors were encountered: