Skip to content Link Search Menu Expand Document
ModalAI DOCS
Store

Using VOXL Docker and VOXL Cross to Build and Deploy Applications


This page will walk you through how to use voxl-docker and the voxl-cross docker image to build and deploy an application onto VOXL. We will use voxl-cross-template as an example. This example simply prints IMU data from VOXL’s onboard sensors to a shell.

Make sure you have Installed VOXL Docker and VOXL Cross first.

We encourage you to follow along!!!

Once you have the template building and deploying, the Example Code page catalogs the other working examples in the SDK to build from.

Background

All ModalAI projects contain these 4 scripts in the root dir:

clean.sh: cleans up build files and .deb packages.

build.sh: builds project without cleaning first; may specify platform target with the following options where appropriate (qrb5165, qrb5165-2, qcs6490, native).

make_package.sh: makes a .deb package after building; takes no argument, or an optional timestamp argument to append a date-time suffix to the package version.

deploy_to_voxl.sh: push the just-generated deb to VOXL and install it with dpkg.

The general workflow is clean, build, make, deploy.

Build Instructions

First, clone the voxl-cross-template repository and cd into it:

me@mylaptop:~/$ git clone https://gitlab.com/voxl-public/voxl-sdk/voxl-cross-template.git
me@mylaptop:~/$ cd voxl-cross-template

1) Launch the voxl-cross docker. After it launches, your terminal pre-cursor should change to voxl-cross:~/$:

me@mylaptop:~/voxl-cross-template$ voxl-docker -i voxl-cross
voxl-cross:~$

2) Install build dependencies inside the docker. You must specify both the hardware platform and binary repo section to pull from. The hardware platform should be qrb5165 (the processor VOXL 2 uses) or qcs6490. The binary repo section can be dev, staging, or a release section such as sdk-1.7. See here for more information.

voxl-cross:~$ ./install_build_deps.sh qrb5165 sdk-1.7

The dev section contains the newest unreleased packages and is unstable — it is intended for internal development. When building against a released SDK, use the matching sdk-X.Y section.

3) Build scripts should take the hardware platform as an argument: qrb5165 for SDK 1.X targets, qrb5165-2 for SDK 2.X targets, qcs6490 for QCS6490-based targets, or native to build with the native compilers. Note that build.sh checks that it is running inside voxl-cross version 4.4 or newer and will refuse to build otherwise.

voxl-cross:~$ ./build.sh qrb5165
OR
voxl-cross:~$ ./build.sh qrb5165-2

4) Make a deb package while still inside the docker.

voxl-cross:~$ ./make_package.sh

This will make a new package (.deb) file in your working directory. The name and version number came from the package control file. If you are updating the package version, edit it there.

Optionally add the timestamp argument to append the current date and time to the package version number in the debian package.

Deploy to VOXL

You can now push the deb package to VOXL and install with dpkg however you like. To do this over ADB, you may use the included helper script: deploy_to_voxl.sh. Do this outside of docker as your docker image probably doesn’t have usb permissions for ADB.

The deploy_to_voxl.sh script will query VOXL over adb to check that dpkg is installed, then push and install the .deb package. If dpkg is not found on the device, the script will report an error.

(outside of docker)
me@mylaptop:~/voxl-cross-template$ ./deploy_to_voxl.sh

This deploy script can also push over a network given sshpass is installed and the VOXL uses the default root password.

(outside of docker)
me@mylaptop:~/voxl-cross-template$ ./deploy_to_voxl.sh ssh 192.168.1.123

Running the Deployed Program

To see your now built and deployed application running on the VOXL, ADB or ssh into your VOXL. In your VOXL’s bash shell, run:

voxl2:/$ voxl-hello-cross

Try arguments -h (for a help menu), -i (to provide an IMU input), and -n (to add a newline after every IMU output). If you add a -i parameter followed by the name of an IMU (press tab after typing -i to see available IMU’s), you should see IMU data being printed to the shell.

You can see that the name of the command to run in the shell is defined in /src/CMakeLists.txt:

SET(TARGET voxl-hello-cross)

Next Steps

This section of the bootcamp has been a short intro to building applications using voxl-cross. This process will suffice for 90% of applications; for the other build environments used instead of voxl-cross in unique circumstances, see the Build Environments page. In addition, writing custom applications has been out of the scope of this Bootcamp.