My Raspberry Pi is installed with ubuntu-server18.04. Since it is not the official raspian system of the Raspberry Pi, it does not come with raspi-config.
To start the camera, you need to use the official raspi-config
configuration program, enter the official website address , and download the latest deb program
wget http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20200817_all.deb
Then enter the folder to install:
dpkg -i raspi-config_xxxxxxxx.deb
xxxx please press Tab to complete automatically
Found a dependency error, repair the dependency:
sudo apt --fix-broken install
Then reinstall.
Later I found out that if ros installed rosdep, it can also be installed with rosdep (not tried)
rosdep install raspi-config_xxxxx.deb
or
rosinstall raspi-config_xxxxx.deb
Use raspi-config to turn on the camera. Refer to https://blog.csdn.net/sinat_25259461/article/details/108353324
sudo raspi-config
If an outdated firmware error occurs:
Your firmwave appears to be out of date (no start_x.elf). Please update
Solution:
Check the device number where the boot partition is located. The device number may be: /dev/mmcblk0p1
df -h
Mount the device number on /boot
mount /dev/mmcblk0p1 /boot
Then it will appear whether it is set to enabled, select yes.
Wait for the Raspberry Pi to restart.
After restarting, plug in the csi camera to check if there is a camera device:
ls -al /dev/ | grep video
There should be vedio0 at this time
Use experience:
CSI camera occupies much less CPU resources than usb camera, but at present ubuntu system I have only tried to open the camera with ros usb_cam node, and the raspicam_node designed for raspberry pie can only be installed on raspian system, ubuntu system is generally lacking mmal library, so the hardware resources of the Raspberry Pi cannot be used effectively, and the python library picamera cannot be used.
The Raspberry Pi CSI lens I bought only supports yuyv, not mjpeg format, so the image transmission frame rate is limited, the maximum can only achieve 30fps frame rate under 920p*720p, larger resolution images will automatically be reduced to 6fps Frame rate.
The usb_cam node also occupies CPU very much after it is started, generally occupying 20% or even 30%. At present, there is no way to enable the camera, so the usb_cam node is only opened when needed.