Skip to content

Cellulo V1 Installation [Linux & Android]

Victor Borja edited this page Dec 2, 2022 · 1 revision

This guide covers the installation of the Cellulo framework on a Linux desktop for development on said Linux desktop and deployment to both Linux and Android.

Tested:

  • On Ubuntu 16.04, 17.10 and 18.04
  • With Android API 23, also known as Android 6 or Marshmallow
  • With Android SDK Tools 25.2.5, newer versions removed many tools such as android required by the Qt deployment workflow so don't go beyond this version
  • With Android NDK r10e
  • With Qt 5.10.0, Qt 5.11.1

Create a repository on c4science, set up SSH keys and VCS password following the guide: https://c4science.ch/w/c4science/

###libdots installation

This is to obtain the command-line tool to overlay the dot pattern on PDFs for localization.

NOTE: While using git clone with HTTPS, if encountered with server certification failed error message, the following command can be used (use it at your own risk): Export GIT_SSL_NO_VERIFY=1 With this command git ignores the SSL certificate verification (https://bytefreaks.net/tag/git_ssl_no_verify).

  1. Install git and cmake.
  • https://cmake.org/install/

  • For Windows, if not added automatically, add the install directory of CMake to system PATH environment variables Note: cmake [] : Uses as the build tree, and loads the path to the source tree from its CMakeCache.txt file, which must have already been generated by a previous run of CMake. The specified path may be absolute or relative to the current working directory.

  1. Install libpodofo-dev and libfreetype6-dev.
  2. Clone https://c4science.ch/diffusion/514/libdots.git, the tool is in tools/pdf-overlayer/.
  3. Follow the build instructions for libdots at https://c4science.ch/diffusion/514/browse/master/tools/pdf-overlayer/README.md.
  4. Use as libdots-pdf-overlayer -i mypage.pdf -o mypage-dotted.pdf.

###Qt framework installation

This is to set up the development environment necessary for Cellulo.

  1. Download Qt Open Source installer from the internet, it should be named something like qt-unified-linux-x64-2.0.5-online.run.
  2. Make this file runnable by chmod 755 qt-unified-linux-x64-2.0.5-online.run.
  3. Run sudo ./qt-unified-linux-x64-2.0.5-online.run, follow the installer.
  4. Create an account or login.
  5. Continue installing in /opt/Qt. You can install somewhere else but you'll have to adapt the path accordingly in the future.
  6. Select Desktop gcc 64-bit and Android ARM v7 from Qt 5.10.0 (could be a beta version depending on the date you're following this guide), others are not necessary.
  7. Finish install.
  8. Important for the future: Run chmod 777 /opt/Qt/5.10.0/gcc_64/qml and chmod 777 /opt/Qt/5.10.0/android_armv7/qml for easier installation of the qml plugins. If you don't do this, you'll have to sudo make install.

###Android SDK installation

This is the first step to be able to deploy Cellulo applications to Android devices. Can be omitted if no Android deployment is desired.

  1. Install openjdk-8-jre and openjdk-8-jdk.

  2. Download http://dl.google.com/android/android-sdk_r22.3-linux.tgz.

  3. Unpack it and move the resulting android-sdk-linux directory to /opt/.

  4. Go to /opt/android-sdk-linux/tools/ and run ./android.

  5. Install the recommended stuff (newer Android SDK Tools, Android SDK Platform-Tools, Android SDK Build-Tools etc. and API 23) and restart with ./android | (*) Note: If faced with “Stopping ADB server failed (code -1)” error while installing, kill the ADB server and restart the server again from the command window, and lastly re-start the IDE.
    |

  6. Install the newest Android SDK Tools, Android SDK Platform-Tools and Android SDK Build-Tools, no need to install any newer API, API 23 is enough. Note that some API version functionalities do not support the Linux environment, yet, therefore manually unselect the latest API version from the SDK installation window and select the newest fully supported API version.

  7. Do the relaunching and installation of newer Android SDK Tools(don't go beyond 25.2.5!), Android SDK Platform-Tools and Android SDK Build-Tools until no newer version is left.

###Android NDK installation

This is the second step to be able to deploy Cellulo applications to Android devices. Can be omitted if no Android deployment is desired.

  1. Download http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip.
  2. Unpack it and move the resulting android-ndk-r10e directory to /opt/.

Two options for the API installation follow 1) or 2)

1) cellulo-core

If you have installed Qt version higher than 5.11, do NOT use this option. Use option 2 | (*) Note: The repositories are cloned from GitHub, hence the SSH key generated and added to the c4science portal must be added to the GitHub portal as well.|
Install all necessary repos from https://c4science.ch/source/cellulo-core/ For each of the installed libraries, follow the build instructions:

Alternatively you can follow the next steps to download each repo separately.

2.1) cellulo-qml-plugin installation

This installs the Cellulo QML plugin which provides the API to work with the robots.(*)

  1. Clone https://c4science.ch/diffusion/505/cellulo-qml-plugin.git.
  2. Set up your github ssh keys on your machine, you can follow https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ and then https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/.
  3. Install mesa-common-dev and libgl1-mesa-dev.
  4. Install also libbluetooth-dev. Can be omitted if no swarm functionality is desired (i.e more than 5 robots, multiple Bluetooth adapters etc.).
  5. Follow the build instructions for desktop at https://c4science.ch/diffusion/505/browse/master/README.md.
  6. Follow the build instructions for Android at https://c4science.ch/diffusion/505/browse/master/README.md. Can be omitted if no Android deployment is desired.

| (*) Note: If you are using Qt 5.11 or older, you can install all cellulo-qml-plugin and the other plugins all at once by cloning and building the project cellulo-core. See https://c4science.ch/source/cellulo-core/ |

2.2) Other qml plugins installation

These are necessary plugins that work alongside cellulo-qml-plugin.

  1. Clone the following:
  2. Follow the build instructions at the README.md files within the plugins, they are the exact same as cellulo-qml-plugin.

###Test an application on the Linux desktop

  1. Launch Qt Creator.
  2. From Open Project in the main screen, load cellulo-qml-plugin/samples/cellulo-hello-world/cellulo-hello-world.pro.
  3. Select the desktop configuration.
  4. When project is loaded, select desktop from the bottom left and click the big green arrow button to launch.

###Test an application on an Android device

  1. Install ant.
  2. Launch Qt Creator.
  3. Go to Tools -> Options -> Devices -> Android, enter the Android SDK Location as /opt/android-sdk-linux and Android NDK Location as /opt/android-ndk-r10e.
  4. From Open Project in the main screen, load cellulo-qml-plugin/samples/cellulo-hello-world/cellulo-hello-world.pro.
  5. Select the Android configuration.
  6. Plug in your Android device that has Debugging over USB enabled.
  7. Select Android from the bottom left and click the big green arrow button to launch it on the Android device.

Note: If a Device has too low API level error is encountered, from within the project files in Qt Creator, go to Other files -> android -> AndroidManifest.xml and change the Minimum required SDK and Target SDK to the device's SDK versions.