Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Also, this tutorial refers to the SDK installation directory as ${SDK_DIR}.

Note

Building external libraries is not supported. Please build the external library by referring to the information provided in this chapter. Please note that we cannot provide support even if you contact us.

Table of contents

...

Table of Contents
minLevel1
maxLevel4

...

Note

If you run it like sudo make, it may fail if the file is created in a location that is not accessible by general users. When executing with sudo make, please check the user settings of the Ubuntu OS and confirm that you have administrative privilegesin advance.

Code Block
$ make
Info

Compiling OpenCV takes some time, so wait for a while.

...

Make sure the files are copied to the destination “${SDK_DIR}/src/adamapp/opencv_edge_detection_app/external/include/opencv2“ directory.

Build the sample application

...

Delete files no longer needed

The information needed for debugging library is included in the OpenCV library you created.

We recommend that you delete this file to reduce the folder size as you do not need this to run the application.

Code Block
$ cd ${SDK_DIR}/src/adamapp/opencv_edge_detection_app

...

/external/lib/aarch64-linux-gnu/
$ aarch64-linux-gnu-strip --strip-debug libopencv_world.so
$ aarch64-linux-gnu-strip --strip-debug libopencv_world.so.4.7.0
$ aarch64-linux-gnu-strip --strip-debug libopencv_world.so.407

 

Build the sample application

Build the sample application "opencv_edge_detection_app" and install it on the camera (eg, it can be installed from the green frame installed from the green frame in the image below).

Please perform the build method according to each SDK version.

Open the app screen (red frame button in the image below),

...

and if the following edge-detected image of the captured by the camera is displayed, it is successful.

See here for how to build.

Open the app screen (red frame button in the image below),

...

and if the following edge-detected image of the captured by the camera is displayed, it is successful.

...

Compile C/C++ module(Curl)

...

Compile C/C++ module(Curl)

...

Prepare the compilation environment

Setup your build environment to use SDK by using “setup_env.sh”

Code Block
$ cd ${SDK_DIR}
$ source setup_env.sh ipro-ambaCV2X
Info

"ipro-ambaCV2X" is specified, but please change it according to your environment.

Download source code

Download libcurl source code from the URLs below.

...

https://curl.se/download.html

...

...

Info

Since there are files for each OS, it is recommended to obtain past versions from Old Releases in the red frame of the image.

Create a directory to store the downloaded source code.

...

Code Block
$ cp -r include/curl ../../../../../../src/adamapp/update_sample_app/external/include

There is no change in the directory structure after copying.

Make sure the files are copied to the destination ${SDK_DIR}/src/adamapp/update_sample_app/external/include

...

There is no change in the directory structure after copying.

Make sure the files are copied to the destination ${SDK_DIR}/src/adamapp/update_sample_app/external/include/curl” directory.

Build the sample application

Build the sample application "update_sample_app" and install it on the camera (eg, it can be installed from the green frame in the image below).

See here for how to build.

Open the app screen (red frame button in the image below),

...

and if the string is displayed like following, it is successful.

{"r_appDataType":"0","r_appData":"CA=="}

...

/curl” directory.

Build the sample application

Build the sample application "update_sample_app" and install it on the camera (eg, it can be installed from the green frame in the image below).

Please perform the build method according to each SDK version.

Open the app screen (red frame button in the image below),

...

and if the string is displayed like following, it is successful.

{"r_appDataType":"0","r_appData":"CA=="}

Compile C/C++ module(SQLite)

...

Prepare the compilation environment

Setup your build environment to use SDK by using “setup_env.sh”

Code Block
$ cd ${SDK_DIR}
$ source setup_env.sh ipro-ambaCV2X
Info

"ipro-ambaCV2X" is specified, but please change it according to your environment.

Download source code

Download SQLite source code from the URLs below.

...

Code Block
$ cd ${SDK_DIR}/external/build/sqlite
$ cp [Downloaded source code storage directory]/sqlite-autoconf-3400000.tar.gz ./
$ tar -zxvf sqlite-autoconf-3400000.tar.gz
$ cd sqlite-autoconf-3400000.tar.gz

Run Configure

Run in the “${SDK_DIR}/external/build/sqlite/sqlite-autoconf-3400000” directory.

...

In this tutorial, the SQLite library has file names of "libsqlite3.so" and "libsqlite3.a", so you will need to modify them accordingly.

Modify ${SDK_DIR}/src/adamapp/sqlite_app/Makefile as follows.

Before) ADD_LIBS+= sqlite


After) ADD_LIBS+= sqlite3

...

/adamapp/sqlite_app/Makefile as follows.

Before) ADD_LIBS+= sqlite


After) ADD_LIBS+= sqlite3

Build the sample application

Before building the sample app, format the SD card using the screen below. (Please confirm in advance whether the SD card can be formatted. All data on the SD card will be erased.)
Once formatting is complete, the SD card as ext (ext4) and press the Set button.

...

Build the sample application "sqlite_app" and install it on the camera (eg, it can be installed from the green frame in the image below).

See here for how to buildPlease perform the build method according to each SDK version.

Open the app screen (red frame button in the image below),

...

Compile in Docker environment to use libjpeg in Ubuntu (64-bit) environment.

Please refer to here to build a Docker environment and create a Docker image.

Download source code

Download libjpeg source code from the URLs below.

This tutorial uses version 9e.

Select the version to download according to the functions you use.

libjpeg (version : 9e)

http://www.ijg.org/files/jpegsrc.v9e.tar.gz

Place the downloaded files to “${SDK_DIR}/external/build/sample/docker/docker_volume” directory.

Update compilation instructions file

Put the compilation instructions to use libjpeg in Ubuntu (64-bit) environment.

Please refer to here to build a Docker environment and create a Docker image.

Download source code

Download libjpeg source code from the URLs below.

This tutorial uses version 9e.

Select the version to download according to the functions you use.

libjpeg (version : 9e)

http://www.ijg.org/files/jpegsrc.v9e.tar.gz

Place the downloaded files to “${SDK_DIR}/external/build/sample/docker/docker_volume” directory.

Update compilation instructions file

Put the compilation instructions in “${SDK_DIR}/external/build/sample/docker/docker_volume/module_compile.sh” file.

Please copy the content below.

Code Block
#!/bin/sh -x

HOME_PATH=/home/docker

LIBJPEG_ARCHIVES=jpegsrc.v9e.tar.gz
LIBJPEG_DIR=jpeg-9e

## for libjpeg
cd ${HOME_PATH}
tar zxf ${LIBJPEG_ARCHIVES}
cd ${LIBJPEG_DIR}
./configure
make

Compile

Compile libjpeg module using docker.

Run Docker in “${SDK_DIR}/external/build/sample/docker/docker_volume/module_compile.sh” file.Please copy the content belowdocker” directory.

Code Block
#!/bin/sh -x

HOME_PATH=/home/$ docker 
LIBJPEG_ARCHIVES=jpegsrc.v9e.tar.gz
LIBJPEG_DIR=jpeg-9e

## for libjpeg
cd ${HOME_PATH}
tar zxf ${LIBJPEG_ARCHIVES}
cd ${LIBJPEG_DIR}
./configure
make

Compile

Compile libjpeg module using docker.

...

run --rm -it --name aarch64-ubuntu -v `pwd`/docker_volume:/home/docker compile/ubuntu-rel:0.1

The compiled module is created in “${SDK_DIR}/external/build/sample/docker/docker_volume/jpeg-9e”.

Deployment in AdamApp

Deploy the modules to use them with AdamApp.

Here we take “${SDK_DIR}/externalsrc/build/sample/docker” directory.

Code Block
$ docker run --rm -it --name aarch64-ubuntu -v `pwd`/docker_volume:/home/docker compile/ubuntu-rel:0.1

The compiled module is created in “$adamapp/jpeg_app” as an example.

 

Deployment in AdamApp

libjpeg module is installed in the following directory.

${SDK_DIR}/external/build/sample/docker/docker_volume/jpeg-

...

9e/.

...

Deployment in AdamApp

Deploy the modules to use them with AdamApp.

...

libs

libjpeg.so.9.5.0

Copy the above file to the AdamApp source directory.

${SDK_DIR}/src/adamapp/jpeg_

...

 

Deployment in AdamApp

libjpeg module is installed in the following directory.

app/external/lib/aarch64-linux-gnu

Code Block
$ cp -r ${SDK_DIR}/external/build/sample/docker/docker_volume/jpeg-9e/.libs

...

/libjpeg.so.9.5.0

...

Copy the above file to the AdamApp source directory.

 ${SDK_DIR}/src/adamapp/jpeg_app/external/lib/aarch64-linux-gnu

Once copied, create a symbolic link.

Code Block
$ cd ${SDK_DIR}/src/adamapp/jpeg_app/external/lib/aarch64-linux-gnu

...

Code Block
$ cp -r /
$ ln -s libjpeg.so.9.5.0 libjpeg.so.9
$ ln -s libjpeg.so.9 libjpeg.so

Then, the directory structure will be as follows.

${SDK_DIR}/

...

src/

...

adamapp/

...

jpeg_app/

...

external/

...

lib/aarch64-linux-gnu/libjpeg.so.9.5.0

...

${SDK_DIR}/src/adamapp/jpeg_app/external/lib/aarch64-linux-gnu

...

/libjpeg.so.9

${SDK_DIR}/src/adamapp/jpeg_app/external/lib/aarch64-linux-gnu/libjpeg.so.9.5.0

 

libjpeg header files are installed in the following directory.

...

Build the sample application "jpeg_app" and install it on the camera (eg, it can be installed from the green frame in the image below).

See here for how to buildPlease perform the build method according to each SDK version.

Open the app screen (red frame button in the image below), and if the image of the captured by the camera is displayed, it is successful.

...