- Using a Waveshare Jetbot kit (https://www.waveshare.com/jetbot-ai-kit.htm)
- 128GB microSD card
- Started with Jetpack 4.5 image
- Set up jetson-inference using the Docker setup
- Set up jetbot using the Docker setup (Using Docker Container - JetBot)
When I try to run data_collection.ipynb
in the “Collision Avoidance” project, I’m at the part where I run the following:
import traitlets
import ipywidgets.widgets as widgets
from IPython.display import display
from jetbot import Camera, bgr8_to_jpeg
camera = Camera.instance(width=224, height=224)
image = widgets.Image(format='jpeg', width=224, height=224) # this width and height doesn't necessarily have to match the camera
camera_link = traitlets.dlink((camera, 'value'), (image, 'value'), transform=bgr8_to_jpeg)
display(image)
The error I’m getting is:
RuntimeErrorTraceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/camera/opencv_gst_camera.py in __init__(self, *args, **kwargs)
29 if not re:
---> 30 raise RuntimeError('Could not read image from camera.')
31
RuntimeError: Could not read image from camera.
During handling of the above exception, another exception occurred:
RuntimeErrorTraceback (most recent call last)
<ipython-input-5-2af115b26558> in <module>
4 from jetbot import Camera, bgr8_to_jpeg
5
----> 6 camera = Camera.instance(width=224, height=224)
7
8 image = widgets.Image(format='jpeg', width=224, height=224) # this width and height doesn't necessarily have to match the camera
/usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/camera/opencv_gst_camera.py in instance(*args, **kwargs)
70 @staticmethod
71 def instance(*args, **kwargs):
---> 72 return OpenCvGstCamera(*args, **kwargs)
/usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/camera/opencv_gst_camera.py in __init__(self, *args, **kwargs)
35 self.stop()
36 raise RuntimeError(
---> 37 'Could not initialize camera. Please see error trace.')
38
39 atexit.register(self.stop)
RuntimeError: Could not initialize camera. Please see error trace.
I’ve looked through a bunch of threads with the same issue, and none of them seem to have a fix that works for me. Any help is appreciated. Thanks!