Structure
The VCA Drivers repository is available with utility scripts, templates, examples and the VCA SDK itself to facilitate the development of the camera connectors.
"requirements" folder
The "requirements" folder contains both essential installation scripts and optional scripts for development.
install_build_requirements.sh: This script installs a specific version of CMake, and the packages purely required to build the camera connectors.
install_test_requirements.sh: This script sets up the environment to build and run tests for the camera connectors.
install_opencv.sh: The repository contains a specific version of OpenCV with FFmpeg, which is also used by VCA. With these 3rd-party libraries installed it is possible to create camera connectors using OpenCV.
install_clangd_language_server_16_0_2.sh (for Dev Container): If the Dev Container development environment is used, it is recommended to use the clangd language server language server This script installs the language server.
"sdk" folder
The VCA Drivers repository comes with a pre-built VCA SDK. The library file, header files, and information about the current SDK version are located in the "sdk" folder.
"drivers" folder
This folder contains examples of camera connectors. You may refer to the implementation of these connectors to get additional insights into the whole concept.
"templates" folder
To facilitate the setup and development of a new camera connector, there are template files with the basic implementation of the essential classes. These include additional files for testing and folders for the camera vendor’s API files. These files and folders in the "templates" folder are not allowed to be edited, they are used by the scaffolding utility script when creating a new connector.
Scaffolding script
The scaffolding utility script is located in the root directory of the repository. As mentioned in the "templates" folder section, this script is intended to facilitate setup of a new camera connector and help to start development.
./scaffolding.sh *connector name*
# The connector name must not contain any space or special characters.
After running the script, a new folder with the specified name will be created in the "drivers" folder. This new folder is based on the "templates" folder. The script will replace the file names and file contents to reflect the new name of the camera connector.
For example, if you run the following script:
./scaffolding.sh MyCam
it will have the following effect:
The mycam folder is created under "drivers"
The source file names start with the MyCam prefix
The camera connector related classes have the MyCam prefix
An empty "lib" folder and the included folders are added for the vendor files
The CMakeLists.txt is updated with the mycam project and mycam library
The build.sh script is added with MyCam build and install commands
The CMakePresets.json and CMakeLists.txt on the root directory are updated with the new configurations for the MyCam camera connector.
MyCam and mycam are intentionally used separately from each other.
The naming convention of the camera connector is currently restricted by VCA. The library file and the connector name must contain only lowercase letters. The script handles the naming.
Build_drivers script
Once the development environment is set up, the available camera connectors in the "drivers" folder can be built from source using the build_drivers script. The script builds the release version of the connectors and packages them ready to use in VCA.
Build_drivers_with_docker script
Through the build_drivers_with_docker scripts, it is possible to build the available camera connectors under the "drivers" folder from source without setting up the development environment using Docker. The script uses the Dockerfile in the root of the repository to create a temporary development environment inside a container and executes the same build_drivers.sh script.
Prerequisites for the scripts
It is important to note that the scripts provided by the VCA Drivers repository might require elevated user rights. For example, run the scaffolding script as follows:
```
chmod 777 scaffolding.sh
sudo ./scaffoldoing.sh MyCam
```