Tutorial for Jevois: Setup the development environment (On Ubuntu 16.04)

Posted on August 29, 2017

0> Theory

Basically, you are going to compile and execute the code on your own computer. After that, you can cross-compile the same code to generate binary files that can be executed on JeVois.

Officially speaking,

It can be compiled natively on your Linux computer (host mode), in which case video will be captured from any connected camera, and video output will be to your computer's display. It can also be cross-compiled for the CPU inside the JeVois smart camera (platform mode), in which case video will be captured from the video sensor inside the JeVois camera, and video output will be streamed over the USB link.

All the following steps can be found on the official websites. Since I haven’t got a JeVois yet, I cannot ensure that this tutorial works on a JeVois. I will keep updating this post in the future.

 

1> Pronounce JeVois Properly

https://translate.google.com/#fr/en/jevois

 

2> Installing Dependencies

In this step, you are going to install the required softwares/libraries so that your computer can compile codes and act like a Jevois. This is quite simple:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DD24C027
sudo add-apt-repository "deb https://jevois.usc.edu/apt xenial main"
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test # needed for gcc-6 on 16.04
sudo apt update
sudo apt install jevois-sdk-dev

If you are using Ubuntu-17 or just want to install a certain part of the dependencies, please refer to the offical guidance.

 

NOTE: It seems that this version of JeVois is somewhat behind update. When I tried to compile the jevoisbase (next step), an error happened:

Scanning dependencies of target ColorFiltering
[ 93%] Building CXX object CMakeFiles/ColorFiltering.dir/src/Modules/ColorFiltering/ColorFiltering.C.o
/xx/jevois/repositories/jevoisbase/src/Modules/ColorFiltering/ColorFiltering.C: In member function ‘virtual void ColorFiltering::process(jevois::InputFrame&&, jevois::OutputFrame&&)’:
/xx/jevois/repositories/jevoisbase/src/Modules/ColorFiltering/ColorFiltering.C:150:7: error: ‘pasteBGRtoYUYV’ is not a member of ‘jevois::rawimage’
       jevois::rawimage::pasteBGRtoYUYV(dst, outimg, w, 0);
       ^

Therefore I strongly recommend you to compile and install the JeVois from the source code (next step) to make sure everything is up to date.

 

3> Compile Source Files

In this step, you are going to compile the JeVois as well as the demo. Download the code with git and use the script to do all the jobs

git clone https://github.com/jevois/jevois.git
cd jevois
./rebuild-host.sh

Take a break to make some coffee or check the offical guidance to understand what is going on.

After that, execute 

./bin/jevois.sh

to run the demo on your laptop. If you see something like this:

then congratulations! You are successfully running the demo on your computer. Actually a whole bunch of binary programs are compiled and install at the same time. What ./bin/jevois.sh does is finding suitable parameters for your computer and call jevois-daemon.

I failed to terminate the program normally and hence I killed it with Ctrl+Z. Please leave a comment if you know how to exit properly. You can type `quit` to terminate it on the terminal where jevois-daemon is being executing.

What you have to do next is to cross-compile the code with rebuild-platform.sh and burn it to a SD card. Since I do not have a JeVois yet, I will update this paragraph in the future.

 

4> Working with other libraries

The same as the last step, you can play with other source code based on the same theory.

git clone https://github.com/jevois/jevoisbase.git
git clone https://github.com/jevois/jevois-sdk.git
git clone https://github.com/jevois/samplemodule.git
git clone https://github.com/jevois/samplepythonmodule.git
git clone https://github.com/jevois/jevois-tutorials.git

I encourage you to read the source code to get a better understanding of how does JeVois work. 

  • Implement a simple piece of code and go through the entire process.
  • Extract the makefile configurations/commands to make a clean compile/install environment. 
  • Check this tutorial for project setup.

Feel free to comment below to discuss issues with the development environment or project ideas with me.

 

None