Table of contents
Overview
AdamAppSDK (Application Development Kit for i-PRO AI Camera) works in Linux environment.
AdamAppSDK operating requirements
For development PC :x86_64(amd64)
For development OS :Ubuntu Linux 16.04 LTS (64bit版)
Ubuntu Linux 18.04 LTS (64bit版)development language :C/C++, Python
In this tutorial, assuming that the OS of the development PC is windows, explain the installation procedure of VirtualBox and Ubuntu.
If the OS of the development PC is Ubuntu, start by establishing the Preparation-for-establishing-the-SDK-development-environment.
Install VirtualBox
Download the installer
Download the VirtualBox installer from the website.
Versions to be installed in the tutorial.
VirtualBox 6.1.36 platform packages
Click "Windows hosts" to download the installer.
Install VirtualBox
Follow the wizard to install.
No changes are required.
Once done, Virtual Box will start.
Establish Ubuntu environment
Download image file
Download the Ubuntu Desktop image file from the website.
Installation target OS in the tutorial
Ubuntu 18.04.6 LTS
Create a virtual machine
Start VirtualBox and click the "New (N)" button.
Select the virtual machine name and OS type.
Virtual machine name : Optional
OS type : Linux
Version : Ubuntu (64bit)
Arbitrarily allocate memory for the virtual machine. Recommended is 1024MB or more.
If you plan to use the AI model conversion tool, please make it at least 4096MB.
Create a virtual hard disk.
The hard disk file type does not need to be changed.
We recommend "Variable size" for the virtual hard disk.
Set arbitrary size.
Once complete, your virtual machine will be created.
Install Ubuntu
Install Ubuntu on the created virtual machine.
Start the created virtual machine.
Click the folder mark in the wizard that starts.
Click Add.
Select the image file you downloaded.
Click Select.
Click "Launch" to start the installation.
Set up Ubuntu
Configure Ubuntu.
Select your language and click Install Ubuntu.
Select your keyboard layout and click Continue.
Click Continue without making any changes.
Click Install without making any changes.
Click Continue.
Select your region and click Continue.
Set your login information and click Continue.
After the installation is complete, reboot the OS.
Type Enter and if it boots, you're done.
Network settings for communicating with the outside world
Configure settings for network access from outside VirtualBox. By default, NAT is set, so please use the setting as it is.
If you want VirtualBox to communicate with the Windows PC running VirtualBox, refer to the following URL and set Host only network.
http://christophermaier.name/blog/2010/09/01/host-only-networking-with-virtualbox
This completes the environment construction of the virtualization software VirtualBox and Ubuntu.
Please continue establishing the SDK environment.
Preparation for establishing the SDK development environment
Settings for downloading and installing software
Set up a package management system ‘apt’ in Ubuntu in order to download and install software tools.
Adjust setting if network is connected to Internet via Proxy.(only in the necessary environment)
Edit /etc/apt/apt.conf as follows
Acquire::http::proxy "http://my.http-proxy.co.jp:Port_Number";
Acquire::https::proxy "http://my.https-proxy.co.jp:Port_Number";
Modify http://my.http-proxy.co.jp:PortNumber and http://my.https-proxy.co.jpd epending on your environment.
Update apt package index.
$ sudo apt-get update
Installing tools for host machine
Install tools for the host machine including a toolchain such as compiler, linker or assembler along with the libraries etc. Use apt-get command for the installation.
Install g++ toolchain.
$ sudo apt-get install g++
Install g++-multilib.
$ sudo apt-get install g++-multilib
Install libjpeg package.
$ sudo apt-get install libjpeg-turbo8-dev
Install g++-multilib again.
$ sudo apt-get install g++-multilib
Install packages for executing 32-bit binary over the 64-bit system
$ sudo dpkg –-add-architecture i386 $ sudo apt-get update $ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
If fails, do also.
$ sudo apt-get install multiarch-support
About i-pro camera SoC
The i-pro camera uses SoC provided by ambarella. Hereafter, ambarella's CV2X (generic term for chip types such as CV2, CV22, CV25, etc.) SoC will be abbreviated as ambaCV2X. There are SoCs such as CV52 with higher performance, in which case it is called ambaCV5X. Please see below for compatibility between the camera and the SoC used.
Installation conditions for applications - Technology Partner FAQ (En) - Confluence (atlassian.net)
Installing modules in accordance with each target
Install Ambarella_Toolchain_Linaro_2018.08 included in AdamAppSDK_DevTools_YYYYMMDD.zip(get here) as a cross compiler to build AdamApps for i-pro ambaCV2X models.
The compiler is located in the following location in AdamAppSDK_DevTool and is Ubuntu 64bit version only.
AdamAppSDK_DevTools_YYYYMMDD/toolchain/Ambarella_Toolchain_Linaro_2018.08
Execute the file as follows to install the cross compiler.
In the environment on VirtualBox, installation may fail on shared directories. Please install in the directory on Ubuntu.
$ sudo apt-get install python3 $ tar xvf Ambarella_Toolchain_Linaro_2018.08.tar.xz $ cd Ambarella_Toolchain_Linaro_2018.08 $ sudo chmod +x ubuntuToolChain-201808 $ ./ubuntuToolChain-201808
If you are prompted for TOOLCHAIN PATH[/usr/local]: when you run ./ubuntuToolChain-201808
, just press enter without typing anything. After that, the installation path will be automatically generated, so enter the Y key.
Installing Google Chrome Browser
Install Google Chrome Browser from the URL below. The location to install Chrome can be either on Windows or on Ubuntu in VirtualBox.
Google Chrome browser :
Installing Adam Operation UI in Chrome
Install the Adam Operation UI extension for Google Chrome.
Click “menu” -> “More tools” -> “Extensions”, and open “Extensions” page.
Open /tool folder using file manager, then drag and drop “AdamControlExtension” folder on Extensions page.
Enable “Developer mode” on Extensions page if you could not install the extension.
If an Auth error is displayed when connecting to the ADAM OPERATION UI, please check the FAQ below.
ADAM OPERATION UI Shows Auth Error - Technology Partner FAQ (En) - Confluence (atlassian.net)
Installing Resource Monitor Extension in Chrome
Install Resource Monitor Extension for Google Chrome. The installation procedure is the same as Adam Operation UI Extension.
Open /tool folder using file manager, then drag and drop “ResourceMonitorExtension” folder on Extensions page.
Please refer to here for the instruction of Resource Monitor.
How to install AdamAppSDK
Installing AdamAppSDK
Unzip iPRO_CAMERA_SDK_Vx_xx.zip(get here) in any directory on your Development PC as indicated below. (iPRO_CAMERA_SDK file name’s Vx_xx is a value of the AdamAppSDK version).
$ cd <The directory in which a developer is going to install AdamAppSDK> $ unzip iPRO_CAMERA_SDK_Vx_xx.zip $ ls –CF iPRO_CAMERA_SDK_Vx_xx/
Be sure to copy the SDK zip file into Ubuntu before extracting the zip file. If you extract it on another OS such as Windows and then move it to Ubuntu, it will not work properly.
The installation is completed.
In the environment on VirtualBox, creation of symbolic links and compilation may fail on shared directories. Install it in a directory on Ubuntu.
Getting the Development License
In principle, only encrypted AdamApp can be installed into i-PRO cameras sold in general. A development license is embedded in SDK so that AdamApp that has not been encrypted can be installed into i-PRO camera with specified MAC address. Please obtain a development license file from i-PRO Co., Ltd. then save the file as shown below.
<AdamAppSDK’s Installation Directry>/conf/development.key
Build the sample app
Build the sample application "additional_info_sample_app" and install it on the camera. If sample application works, the construction of the SDK development environment is completed.
Only the minimum necessary steps are described. Please see here for details on how to develop.
Generate and place source files
Source files of the AdamApp must be placed in the following directory.
<AdamAppSDK installation directory>/src/adamapp
The Python source code should be placed below.
<AdamAppSDK installation directory>/src/adamapp-py
Thus, source codes of the sample program (SkeltonSampleApp) should be placed in the following directory.
<AdamAppSDK installation directory>/src/adamapp/additional_info_sample_app
When you generate new AdamApp, also generate the following directory and place the source files, header files and Makefile in there.
<AdamAppSDK installation directory>/src/adamapp/<directory name of the new AdamApp>
It’s recommended that you copy and modify additional_info_sample_app directory to generate new application for ease.
By copying the skeleton_sample_app directory and creating a new directory, the set of files necessary to create a new AdamApp will also be copied. It’s recommended that you copy and modify skeleton_sample_app directory to generate new application for ease.
*For Python, we recommend using the jpeg_app directory.
Build the sample app
setup_env.sh is provided as a setup file for the building environment. You can set up building
environment by reading setup_env.sh using ‘source’ command with parameter depending on execution
environment of AdamApp.
Addressable parameters are as follows:
When creating an AdamApp that runs on i-pro ambaCV2X model ipro-ambaCV2X
*When creating an AdamApp that runs on i-pro ambaCV2X model
$ cd <directory of installed AdamAppSDK> $ source setup_env.sh ipro-ambaCV2X ***** /usr/local/linaro-aarch64-2018.08-gcc8.2/bin/aarch64-linux-gnu-gcc found. ***** PF_BASEDIR = /home/user/adamappsdk BUILD_TARGET = ipro-ambaCV2X TARGET_FOR_ADAM = ambaCV2X TARGET_ARCH = aarch64-linux-gnu VERBOSE = 0 PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Execute make (build and generate package of AdamApp)
You will need to execute make to build and generate an AdamApp package. AdamApp package will be build and generated automatically. When it is successful, the following three files are generated within skelton_sample_app directory.
AdditionalInfoSampleApp : The execution program of additional_info_sample_app
AdditionalInfoSampleApp.zip :The package of additional_info_sample_app
AdditionalInfoSampleApp.ext :Encoded file by BASE64
$ cd <directory of installed AdamAppSDK> $ cd src/adamapp/additional_info_sample_app $ make
The following error may occur during make.make: execvp: <AdamAppSDK installation directory>/tool/adamapp_configurator: Permission denied
In that case, please set the permissions of adamapp_configurator as shown below and make again.cd <AdamAppSDK installation directory>/tool
sudo chmod +x adamapp_configurator
Operation check of the sample application
Install the created "AdditionalInfoSampleApp.ext" to the camera and check the operation.
Here, access the camera from the web browser as shown below and try the installation.
Install from the green frame of the image. Press the file selection button, select the created "AdditionalInfoSampleApp.ext", and execute the installation.
When the installation is complete, press the red frame button in the image and check the operation of the sample application.
If the string similar to following is displayed on the application screen, the establish of the development environment is successful.
{"r_appDataType":"0","r_appData":"e3tMYW5ndWFnZTowfX0="}