I have a TurtleBot3 Burger robot which has a Raspberry Pi 3B+ on it. And the RPI has to run Ubuntu 20.04 OS, otherwise I can't use ROS and eventually the robot functionalities.
The RPI has a picamera v2.1 on it and my goal is to program using picamera python library. I am able to take a picture using raspistill
command. But when I try to run a simple program on Python, which takes a picture and saves it, then I get the following error:
Code:
# source: https://picamera.readthedocs.io/en/release-1.13/recipes1.html
from time import sleep
from picamera import PiCamera
camera = PiCamera()
camera.resolution = (1024, 768)
camera.start_preview()
# Camera warm-up time
sleep(2)
camera.capture('foo.jpg')
Error:
mmal: mmal_component_create_core: could not find component 'vc.camera_info'
Traceback (most recent call last):
File "test.py", line 4, in <module>
camera = PiCamera()
File "/usr/local/lib/python3.8/dist-packages/picamera/camera.py", line 367, in __init__
with mo.MMALCameraInfo() as camera_info:
File "/usr/local/lib/python3.8/dist-packages/picamera/mmalobj.py", line 2346, in __init__
super(MMALCameraInfo, self).__init__()
File "/usr/local/lib/python3.8/dist-packages/picamera/mmalobj.py", line 631, in __init__
mmal_check(
File "/usr/local/lib/python3.8/dist-packages/picamera/exc.py", line 184, in mmal_check
raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create MMAL component b'vc.camera_info': Function not implemented
Is there a way to use Picamera like this, or is it not possible with Ubuntu 20.04?
libraspberyypi-bin
andlibraspberyypi-dev
; indeed, that seems to getraspistill
andraspivid
working. Is that not correct?