Link Search Menu Expand Document

Qualcomm Flight RB5 SDK Camera Server

Table of contents

  1. rb5-camera-server
    1. Camera Information
    2. Architecture
    3. How to Build and Install
    4. How to Use
      1. Configure to Run on Bootup
      2. View Service Status
      3. Use a Provided Test Client
      4. View Named Pipes in File System
      5. How to Change What Cameras Are Started on Bootup

rb5-camera-server

The rb5-camera-server allows you to publish data from any of the 6 cameras on the platform.

Camera Information

IDSummaryUsageSensorPipeline
0Front Stereo, LeftVOA (front)ov7251640x480, Bayer B&W 10bit, 30 FPS, hw synced with 1
1Front Stereo, RightVOA (front)ov7251, master640x480, Bayer B&W 10bit, 30 FPS, hw synced with 0
2Front TrackingVIO (front)ov7251640x480, Bayer B&W 10bit, 30 FPS
3Front Hi-resFPV (front)IMX2144208x3120 (4k), Bayer RGGB 10bit, 30 FPS
4Rear Stereo, LeftVOA (rear)ov7251640x480, Bayer B&W 10bit, 30 FPS, hw synced with 5
5Rear Stereo, RightVOA (rear)ov7251, master640x480, Bayer B&W 10bit, 30 FPS, hw synced with 4

Architecture

In summary, this is what’s happening:

Image Sensor 
  --> Kernel 
    --> CameraX/GST
      --> rb5-camera-server  
        --> a named pipe getting frames
           --> code reading from named pipe doing stuff

How to Build and Install

If you have a Qualcomm Flight RB5, it comes pre-loaded with the software and there’s no need to re-install unless you want to. If you want to see the source, build and tweak it, the repo is COMING-SOON.

How to Use

Configure to Run on Bootup

Generally, we want to have the computer vision processing start up on bootup. On the Qualcomm Flight RB5, that’s the default setup for camera IDs 0, 1, 2, 4 and 5 (the core computer vision sensors)

The rb5-camera-server package installs with a configuration script. You can run the following after you adb onto the target.

  • adb onto target
adb shell
sh-4.4# 
  • Enable the default computer vision cameras (0, 1, 2, 4, 5) to start on bootup by selecting 1) yes
sh-4.4# rb5-camera-server-configure 

Would you like to enable the camera service?
This will start all cameras in a background process
Selecting yes will start the service, no will disable the service

1) yes
2) no
#? 1

View Service Status

We use a ‘templated’ systemd unit file…. so the services show up a little different:

IDSummaryUsage
0Front Stereo, Leftsystemctl status rb5-camera-server@0
1Front Stereo, Rightsystemctl status rb5-camera-server@1
2Front Trackingsystemctl status rb5-camera-server@2
3Front Hi-resnot started by default, used upon request for FPV stream
4Rear Stereo, Leftsystemctl status rb5-camera-server@4
5Rear Stereo, Rightsystemctl status rb5-camera-server@5

For example, camera 0 after successfully starting:

sh-4.4# systemctl status rb5-camera-server@0

● rb5-camera-server@0.service - "rb5-camera-server-0"
   Loaded: loaded (/usr/bin/rb5-camera-server; indirect; vendor preset: enabled)
   Active: active (running) since Mon 2021-07-26 16:28:00 UTC; 15s ago
 Main PID: 9522 (rb5-camera-serv)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/system-rb5\x2dcamera\x2dserver.slice/rb5-camera-server@
           └─9522 /usr/bin/rb5-camera-server -c0

Jul 26 16:28:00 qrb5165-rb5 systemd[1]: Started "rb5-camera-server-0".
Jul 26 16:28:00 qrb5165-rb5 rb5-camera-server[9522]: gbm_create_device(156): Inf

Use a Provided Test Client

If you want to test a camera, for example camera ID 5, run the following:

sh-4.4# rb5-camera-client -c 0

camera ID is set to 0
Waiting for server to start: /dev/rb5-camera-pipe-0

View Named Pipes in File System

The interface the rb5-camera-server provides are named pipes where you can read camera frames and meta data from.

sh-4.4# ls -la /dev/rb5-camera*

prw-r--r-- 1 root root 0 Jul 26 15:45 /dev/rb5-camera-pipe-0
prw-r--r-- 1 root root 0 Jul 26 15:45 /dev/rb5-camera-pipe-1
prw-r--r-- 1 root root 0 Jul 26 15:45 /dev/rb5-camera-pipe-2
prw-r--r-- 1 root root 0 Jul 26 15:45 /dev/rb5-camera-pipe-4
prw-r--r-- 1 root root 0 Jul 26 15:45 /dev/rb5-camera-pipe-5

How to Change What Cameras Are Started on Bootup

Currently, the camera’s initialization setup is handled here:

/usr/bin/rb5-camera-server-configure

You’ll find usage like below, where you can enable/disable by ID:

# enables service which starts all cameras
enable_service () {
	echo "reloading systemd services"
	systemctl daemon-reload

	echo "enabling /starting rb5-camera-server systemd service"

	# front tracking
	systemctl enable rb5-camera-server@2.service
	systemctl restart rb5-camera-server@2.service